If you have ever stared at a survey dataset and wished the numbers meant something cleaner, you have already met the need for recoding. Maybe your questionnaire coded “Strongly disagree” as 1 and “Strongly agree” as 5, but your analysis needs the scale flipped. Maybe age was entered as exact years and you need age groups. Maybe a “Yes/No” question was coded 1 and 2, and you need proper 0 and 1 values for a regression model. All of these jobs are done with one SPSS tool: Recode.
Recoding means changing the values of a variable according to rules you define. SPSS gives you two versions of the tool, and choosing the wrong one is the single most common beginner mistake: one overwrites your original data, and the other keeps it safe. This tutorial walks you through both, click by click, with the syntax you can paste and reuse.
What Does Recoding Mean in SPSS?
Recoding replaces old values with new values. For example, you might turn:
- 1 = “Male” and 2 = “Female” into 0 = “Male” and 1 = “Female” for a regression model
- Ages 18–29, 30–44, 45–59 and 60+ into four age-group codes
- A 1-to-5 agreement scale into a reversed 5-to-1 scale
- Missing-value codes such as 99 (“Not applicable”) into SPSS system-missing values
Recoding does not change what your respondents said. It changes how those answers are stored so your analysis reads them correctly. That distinction matters: a careless recode can silently change your results, which is why the “same vs different variables” choice deserves your full attention.
Recode Into Same vs Different Variables: The Key Difference
SPSS offers two commands that look almost identical but behave very differently:
Recode into Same Variables
This replaces the values inside the original variable. The old values are gone unless you can undo the change or reload the data file. It is quick, and it is risky.
Recode into Different Variables
This creates a brand-new variable holding the recoded values and leaves the original untouched. You can check your work, compare old and new side by side, and fix mistakes without losing anything.
Here is the rule to live by: use Recode into Different Variables by default. Use Recode into Same Variables only when you are deliberately tidying a variable you no longer need in its original form, and only after saving a backup copy of your data file. In this tutorial, the main walkthrough uses Different Variables, and the Same Variables steps are included so you know both.
Before You Recode: Three Quick Checks
First, look at your variable. Run Analyze > Descriptive Statistics > Frequencies on it and note the current values, their labels, and any missing-value codes. You cannot write sensible recode rules if you do not know what is in the variable now.
Second, decide your new coding scheme on paper before you touch any dialog box. Write down each old value and its new value, including what happens to missing codes. If you are collapsing categories, decide the cut points in advance rather than inventing them while clicking.
Third, save a backup copy of your data file. Even with Different Variables, a backup costs seconds and saves hours. Use File > Save As and add something like “_backup” to the file name.
How to Recode Into Different Variables in SPSS (Step by Step)
Imagine a variable called “satisfaction” coded 1 (Very dissatisfied) to 5 (Very satisfied), and you want a new variable called “satisfaction_high” coded 0 for scores 1–3 and 1 for scores 4–5.
- Click Transform > Recode into Different Variables.
- In the variable list on the left, select your original variable and click the arrow to move it into the “Numeric Variable -> Output Variable” box.
- In the “Output Variable” section on the right, type a Name for the new variable (for example, satisfaction_high) and an optional Label (for example, “High satisfaction (4-5 = 1)”). Click Change. The name now appears in the middle box.
- Click Old and New Values. This is where the actual rules live.
- In the “Old Value” panel, select Range and type 1 through 3. In the “New Value” panel, select Value and type 0. Click Add. Your rule appears in the “Old -> New” list.
- Repeat for the second rule: Old Value Range 4 through 5, New Value 1, click Add.
- If your variable has a missing code such as 99, add a rule for it: Old Value 99, New Value “System-missing”, click Add. Skipping this step is a classic error — a 99 left in the data will be treated as a real score of 99 in means and correlations.
- Click Continue, then OK.
SPSS creates the new variable at the end of your dataset. Switch to Data View, scroll right, and check it against the original variable row by row for a few cases. Then run Frequencies on the new variable to confirm the counts match what you expected.
How to Recode Into Same Variables in SPSS (Step by Step)
The steps are nearly identical, with one important difference: there is no new variable.
- Save a backup copy of your data file first. This is not optional for Same Variables.
- Click Transform > Recode into Same Variables.
- Move your variable into the “Numeric Variables” box.
- Click Old and New Values and build your rules exactly as above (old value or range on the left, new value on the right, Add after each rule).
- Click Continue, then OK.
Check the result immediately with Frequencies. If anything looks wrong, close the file without saving and reopen your backup — another reason the backup matters.
Recoding Ranges, Single Values, and Everything Else
The Old and New Values dialog gives you several ways to describe old values:
- Value: a single value, such as 99.
- System-missing: values SPSS already treats as missing.
- System- or user-missing: any missing value, system or user-defined.
- Range: a span such as 1 through 3.
- Range, LOWEST through value: everything up to a cut point, such as LOWEST through 29 for “under 30”.
- Range, value through HIGHEST: everything from a cut point upward, such as 60 through HIGHEST for “60 and over”.
- All other values: a catch-all for anything not covered by earlier rules. Use it with care — it can sweep up codes you forgot about, including missing codes.
A practical example: turning exact age into age groups uses three range rules (LOWEST through 29 becomes 1, 30 through 44 becomes 2, 45 through 59 becomes 3, 60 through HIGHEST becomes 4), plus a rule sending 999 to system-missing. After recoding, add value labels to the new variable in Variable View so 1, 2, 3 and 4 display as meaningful group names instead of bare numbers.
Reversing a Scale: A Worked Example
Reverse-scoring is the most common recoding job in questionnaire research. Suppose items on a 1-to-5 scale need reversing so that high scores always mean a positive attitude. The rules are: 1 becomes 5, 2 becomes 4, 3 stays 3, 4 becomes 2, and 5 becomes 1. Recode into a Different Variable (for example, item3_rev), add one rule per value, and then check that the reversed item correlates positively with the other items on the scale. If it correlates negatively, you probably reversed the wrong item or missed a value — both easy to fix when the original is still intact.
Paste-Ready SPSS Syntax for Recoding
Menus are great for learning, but syntax is how you make your work reproducible. The syntax below recreates the satisfaction example from this tutorial. Paste it into a syntax window (File > New > Syntax), replace the variable names with your own, select all, and click Run.
* Recode satisfaction (1-5) into a binary high-satisfaction variable. * Original variable is kept untouched; 99 is set to system-missing. RECODE satisfaction (1 thru 3=0) (4 thru 5=1) (99=SYSMIS) INTO satisfaction_high. EXECUTE. VARIABLE LABELS satisfaction_high 'High satisfaction (4-5 = 1)'. VALUE LABELS satisfaction_high 0 'Low to neutral (1-3)' 1 'High (4-5)'. FREQUENCIES VARIABLES=satisfaction satisfaction_high /ORDER=ANALYSIS.
For a Same Variables recode, the syntax drops the INTO part:
* WARNING: this overwrites the original variable. Save a backup first. RECODE satisfaction (1=5) (2=4) (3=3) (4=2) (5=1). EXECUTE.
Save your syntax file alongside your data. When a supervisor or reviewer asks how a variable was built, the syntax file is your answer.
How to Interpret the Output and Check Your Work
Recoding produces no test statistic and no p-value, so “interpreting the output” here means verifying the recode did what you intended. Run Frequencies on both the original and the new variable and compare:
- Do the counts add up? The number of cases in each new category should equal the combined counts of the old values feeding into it.
- Are missing values still missing? A missing code that survived as a real number will show up as an impossible value in the new variable’s frequency table.
- Do the extremes make sense? Check the minimum and maximum of the new variable. A maximum of 99 in a 0/1 variable means a missing code slipped through.
- Spot-check individual cases in Data View. Pick five cases and confirm each new value follows from its old value.
If any check fails, fix the rules and rerun — with Different Variables, this costs nothing but a minute.
Common Recoding Mistakes (and How to Avoid Them)
Overwriting the original variable
Recoding into Same Variables without a backup is the mistake you only make once, because recovering the original values usually means re-entering data. Default to Different Variables.
Forgetting missing-value codes
Codes like 99, 999 or -9 look like data to SPSS. Always add an explicit rule sending them to system-missing, and confirm they vanished in the frequency table.
Collapsing categories after looking at the results
Deciding cut points after peeking at group differences can bias your findings. Choose cut points from theory, published practice, or your pre-registered plan — not from whichever split gives the result you want.
Skipping value labels
A new variable coded 0 and 1 without labels is a puzzle for future-you and for anyone else reading your output. Label every new variable and its values in Variable View.
Recoding a string variable with numeric rules
If your variable stores text (for example, “Yes” and “No” as words), the numeric recode dialog will not accept it. Convert it first or use Transform > Automatic Recode, which assigns numbers to text categories.
Reporting in APA Style (7th ed.)
Recoding is a data-preparation decision, and APA style expects such decisions to be reported transparently in the Method section so readers can judge and replicate your analysis. You do not report a recode in a results table; you describe it briefly where you describe your measures or data screening. A good sentence names the original variable, the rule, and the reason. For example: “Responses on the 5-point satisfaction scale were dichotomized for analysis, with scores of 4–5 coded as high satisfaction (1) and scores of 1–3 coded as low to neutral satisfaction (0); cases coded 99 (not applicable) were set to missing.” If you collapsed age into groups, give the cut points: “Age was grouped into four categories (18–29, 30–44, 45–59, and 60 years and older) for descriptive reporting.” When an item was reverse-scored, say so: “Item 3 was reverse-scored before scale scores were computed so that higher scores consistently indicated a more positive attitude.” Keep it to a sentence or two per recode — enough for replication, not a full methods essay.
Key Takeaways
- Recoding replaces old values with new values you define, for jobs like reversing scales, grouping ages, and preparing binary predictors.
- Recode into Different Variables creates a new variable and keeps the original safe — make it your default.
- Recode into Same Variables overwrites the original — only use it after saving a backup.
- Always handle missing-value codes explicitly, or codes like 99 will be treated as real scores.
- Check every recode with Frequencies on old and new variables before running any analysis.
- Save your syntax: it documents exactly how each variable was built.
Frequently Asked Questions
What is the difference between recode into same and different variables in SPSS?
Recode into Same Variables replaces the values in the original variable, permanently unless you have a backup. Recode into Different Variables creates a new variable with the recoded values and leaves the original untouched. Different Variables is safer and is the recommended default.
How do I recode a variable in SPSS without losing my original data?
Use Transform > Recode into Different Variables, give the new variable a name, and define your old-to-new rules. Your original variable stays exactly as it was, so you can compare old and new values and redo the recode if needed.
Can I recode multiple values at once in SPSS?
Yes. In the Old and New Values dialog you can add as many rules as you need — single values, ranges, LOWEST through a value, a value through HIGHEST, and an “all other values” catch-all. Each rule is added to the list before you click Continue.
Why is my recoded variable showing the wrong values?
The most common causes are a missing-value code (like 99) that was never sent to system-missing, rules added in the wrong order so a catch-all rule swallowed values first, or recoding the wrong variable. Run Frequencies on the original variable, compare it with your rules, and rebuild the recode into a new variable.
Do I need syntax to recode variables in SPSS?
No, the menus work fine. But syntax makes your recode reproducible: you can rerun it on a fresh data file, share it with a supervisor, and prove exactly how a variable was constructed. The RECODE command with an INTO clause is the syntax version of Recode into Different Variables.
Need this done on your data? Get a free quote → /services/