Reverse coding in SPSS Statistics
Introduction
There are many reasons why you might need to reverse code a variable in SPSS Statistics, but the most common is when you are trying to generate a scale or subscale from a series of Likert items (that you might have asked as part of a questionnaire or survey), and one or more of your questions is coded in the opposite direction to what you would like. For example, you might have a Likert item similar to the one below:
You might have coded the question as follows:
However, the (sub)scale requires that "strongly disagree" is equal to "5", "disagree" is equal to "4", and so on (i.e., the numerical coding is reversed). What you actually need is for the coding to be as follows:
Luckily, in SPSS Statistics reverse coding is relatively easy to do and you do not need to go through your responses changing them manually. You can reverse code your variables by following the instructions below:
SPSS Statistics
Data setup in SPSS Statistics
The data for this example has been set up as follows (where Qu1 is the variable that needs to be reverse coded):
Published with written permission from SPSS Statistics, IBM Corporation.
On the left you have the responses to the questions and on the right the underlying original coding. You can toggle between these by clicking the Value Labels (
) icon on the main toolbar. The setup of categorical data (ordinal data, in this instance) in SPSS Statistics is explained in our guide: Working with variables.
SPSS Statistics
SPSS Statistics procedure to reverse code a variable
There is no special menu dedicated to reverse coding, so you need to go through the more generic recoding procedure. The first decision you need to make is whether to overwrite the values of the existing variable, Qu1, with the reverse coded responses, or recode into a new variable. Unless you have very good reason to do so, you should never "destroy" your original data unless it is absolutely necessary. Therefore, you should create a new variable to store your newly recoded variable, which shall be called Qu1R in this example.
- Click Transform > Recode into Different Variables... on the top menu, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
You will be presented with the Recode into Different Variables dialogue box, as shown below:

Published with written permission from SPSS Statistics, IBM Corporation.
- Transfer the variable to be reverse coded, Qu1, into the Numeric Variable -> Output Variable: box, by using the
button. You will end up with the following screen:
Published with written permission from SPSS Statistics, IBM Corporation.
You will notice that the –Output Variable– area is no longer "greyed out", and neither is the
button.
- The –Output Variable– area is where you enter the new variable name and label (i.e., into the Name: and Label: boxes, respectively). Therefore, create a new variable called Qu1R to hold the recoded values and give it a label of "Qu1 reverse coded", as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
- Click on the
button to create this new variable. You will be presented with an updated Numeric Variable -> Output Variable: box, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
- Click on the
button and you will be presented with the Recode into Different Variables: Old and New Values dialogue box, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
In this example, you want the old values to be converted into new values as follows:
1 (old) becomes 5 (new)
2 (old) becomes 4 (new)
3 (old) becomes 3 (new)
4 (old) becomes 2 (new)
5 (old) becomes 1 (new)
- Enter "1" into the Value: box in the –Old Value– area and enter "5" into the Value: box in the –New Value– area, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
- Click on the
button. This will commit the changes and you will see a new entry in the Old --> New: box reflecting this particular recoding, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
This is telling SPSS Statistics to replace any response of "1" in the Qu1 variable with a "5" in the new variable, Qu1R.
Note: In the steps that follow, you will repeat the process above for the other values that need recoding so that you end up with the following screen:
You can see all the recoding instructions in the Old --> New: box above.
- Enter "2" into the Value: box in the –Old Value– area and enter "4" into the Value: box in the –New Value– area, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
- Click on the
button. This will commit the changes and you will see a new entry in the Old -->New: box reflecting this particular recoding, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
This is telling SPSS Statistics to replace any response of "2" in the Qu1 variable with a "4" in the new variable, Qu1R.
- Enter "3" into the Value: box in the –Old Value– area and enter "3" into the Value: box in the –New Value– area, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
- Click on the
button. This will commit the changes and you will see a new entry in the Old --> New: box reflecting this particular recoding, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
This is telling SPSS Statistics to keep any response of "3" in the Qu1 variable as a "3" in the new variable, Qu1R.
- Enter "4" into the Value: box in the –Old Value– area and enter "2" into the Value: box in the –New Value– area, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
- Click on the
button. This will commit the changes and you will see a new entry in the Old --> New: box reflecting this particular recoding, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
This is telling SPSS Statistics to replace any response of "4" in the Qu1 variable with a "2" in the new variable, Qu1R.
- Enter "5" into the Value: box in the –Old Value– area and enter "1" into the Value: box in the –New Value– area, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
- Click on the
button. This will commit the changes and you will see a new entry in the Old --> New: box reflecting this particular recoding, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
This is telling SPSS Statistics to replace any response of "5" in the Qu1 variable with a "1" in the new variable, Qu1R.
- Click on the
button and you will be returned to the Recode into Different Variables dialogue box, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
- Click on the
button to generate the new variable containing the reverse coded responses. You will be presented with the following screen:
Published with written permission from SPSS Statistics, IBM Corporation.
You will see that a new variable has been added, called Qu1R. To see the reverse coding of the numbers, click on the
icon on the main toolbar and you will get a clear view of the recoding, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
Note: For extra clarity, the number of decimal places has been reduced to zero and the variable types has been change to "ordinal": Qu1R. To know how to do this, see our guide: Working with variables.
You can leave the data in the numeric format if you wish. Alternately, you can add a new set of Value Labels for the new variable, Qu1R, by going to the Variable View window and adding some Value Labels, as shown below (a full explanation of setting up variables is provided in our guide: Working with variables:
Published with written permission from SPSS Statistics, IBM Corporation.
Firstly, notice that the new Value Labels reflect the new coding system. This is because the answers stay the same (i.e., it is irrelevant how you internally coded the system; if someone answered "Agree", for example, this will remain the case regardless of the coding system). Once you click on the
button, and then return to the Data View window, you will see the same answer response despite the underlying coding having been reversed, as shown below (remember to click the
button):
Published with written permission from SPSS Statistics, IBM Corporation.
You have now successfully reverse coded your values. You can now repeat this process for any other variables that need reverse coding.
SPSS Statistics
Syntax
If you prefer working in syntax, the syntax for the reverse coding (but not the Value Labels) for this example is:
Published with written permission from SPSS Statistics, IBM Corporation.
Referencing
Laerd Statistics (2025). Reverse coding in SPSS Statistics. Statistical tutorials and software guides. Retrieved from https://statistics.laerd.com/