Open the app

TRTT › Guides › Convert SPSS .sav to CSV or Excel (and Keep Value Labels)

Convert SPSS .sav to CSV or Excel (and Keep Value Labels)

You can convert a .sav file to CSV or Excel for free without SPSS: open it in a browser tool that reads SPSS files, choose whether each cell should hold the numeric code or its value label, and export. In TRTT the whole conversion happens on your own computer, so the survey file is never uploaded to a conversion site.

The one decision that matters is values or labels. Make it on purpose, because a CSV file can only hold one of them.

Values or labels?

A .sav file stores a number in each cell and, separately, a label for that number: 1 = Strongly disagree, 5 = Strongly agree. CSV and Excel have no place for that second layer, so the export has to pick.

Export A cell looks like Use it when
Data values 4 You'll analyse the data in R, Python, Stata or Excel formulas; you want to compute means of Likert items
Value labels Agree You're sharing the data with people who don't have the codebook; you're building pivot tables or charts in Excel

Labels are applied only where a label exists. A value without a label (an age of 37, say) is written as the number in both modes.

If you're not sure, export twice: once with values for analysis, once with labels for reading. And keep the .sav as your master file (see below).

Converting in the browser, step by step

TRTT is a free SPSS-style statistics app that runs in a desktop browser. It reads .sav files, including variable and value labels, missing-value definitions and date formats.

  1. Go to trtt.app on your computer.
  2. Open your file with File ▸ Open Data… or drag the .sav onto the page. (To practise first, click Sample Dataset on the welcome screen.)
  3. Optional: check the data in Data View, and the labels in Variable View.
  4. Choose File ▸ Export…. The Export Data dialog opens.
  5. Type a File name.
  6. Under Format, pick Comma-separated (CSV) or Excel (XLSX). The file extension updates to match.
  7. For CSV, choose the Delimiter (Comma, Semicolon or Tab) and the Text qualifier (default "). If your Excel uses a comma as the decimal separator, as in much of Europe, Semicolon usually opens more cleanly. For Excel, you can name the Worksheet (default Sheet1).
  8. Leave Write variable names to first row ticked unless you need a header-less file.
  9. Under Save value labels where defined, choose Save data values or Save value labels.
  10. Click OK. The file downloads to your usual downloads folder.

The dialog also has a Paste button: instead of exporting, it writes the matching SAVE TRANSLATE command into the Syntax window, so you have a record of the settings you used. To actually export, use OK; the browser can only save files through its own download dialog.

The TRTT app for iPhone and iPad has the same Export Data options (the button is called Export rather than OK). There, the free version handles datasets of up to 100 cases; the web version has no paid plan.

Excel dates and missing values

Two details trip people up after a conversion:

Dates. SPSS stores a date as a number of seconds since 14 October 1582. A careless conversion gives you a column of 11-digit numbers. TRTT handles it per format:

Missing values. SPSS has two kinds, and they export differently:

What CSV and Excel can't keep

A converted file holds the cells. Everything else that makes a .sav useful stays behind:

Lost in conversion Why it matters
Variable labels (Q4. Likelihood to recommend (0-10)) Only the short variable name survives in the header
The other half of the value labels You keep codes or labels, not both
Missing-value definitions 9 or Refused looks like a real answer
Measurement level (nominal, ordinal, scale) Software can't tell an ordered scale from a category list
Display formats and widths Decimals and column widths reset
Weight variable setting The weight column is exported, but nothing marks it as the weight
Multiple-response sets The set definition is gone; only the individual columns remain

That's why the .sav should stay your master file. Convert copies for sharing or for a specific tool, and make edits in the .sav (or in syntax), not in the spreadsheet.

Converting back: CSV or XLSX to .sav

Going the other way takes three steps in the same tool:

  1. File ▸ Import Data… and pick a .csv, .txt, .tsv or .xlsx file. The Import Data wizard shows a preview. For text files, the delimiter is auto-detected (you can override it: comma, semicolon, tab or pipe); for Excel files, choose the worksheet and, optionally, a cell range. Tick First row contains variable names if it does, and click OK.
  2. In Variable View, add what the spreadsheet couldn't carry: variable labels, value labels, missing values and measurement levels.
  3. File ▸ Save As… downloads a .sav file with that metadata included, ready for SPSS-compatible tools.

Excel columns that contain only dates are imported as date variables, so they come back as dates rather than serial numbers.

R and Python one-liners

If you already work in code, you don't need a separate converter.

R with haven and writexl:

library(haven)
df <- read_sav("survey.sav")
write.csv(zap_labels(df), "survey_values.csv", row.names = FALSE)   # codes
write.csv(as_factor(df), "survey_labels.csv", row.names = FALSE)    # labels
writexl::write_xlsx(as_factor(df), "survey_labels.xlsx")

Python with pyreadstat and pandas:

import pyreadstat
df, meta = pyreadstat.read_sav("survey.sav")                                # codes
df.to_csv("survey_values.csv", index=False)
df_lab, meta = pyreadstat.read_sav("survey.sav", apply_value_formats=True)  # labels
df_lab.to_excel("survey_labels.xlsx", index=False)                           # needs openpyxl

One difference from the TRTT export: by default, both haven and pyreadstat turn user-missing codes into empty values (NA / NaN). Use user_na = TRUE in haven or user_missing=True in pyreadstat if you want to keep the original codes. To go back to .sav, both libraries have a write_sav function.

Open TRTT in your browser – free

Related: How to open a .sav file without SPSS · What is a .sav file? · R vs SPSS

FAQ

How do I convert a .sav file to Excel without SPSS?

Open the .sav in a tool that reads SPSS files, such as TRTT in your browser, then use File ▸ Export…, choose Excel (XLSX) and pick values or value labels. R (haven + writexl) and Python (pyreadstat + pandas) do the same in a few lines.

Can I keep both the codes and the labels?

Not in one CSV column. Export twice (once with data values, once with value labels) or keep the .sav alongside the spreadsheet as the codebook.

Is my file uploaded when I convert it in TRTT?

No. The file is read and converted inside your browser on your own computer. The web app sends anonymous feature-usage counters, not your data, and turns them off if your browser sends Global Privacy Control or Do Not Track.

Why are my dates showing as big numbers?

The converter wrote SPSS's internal date values (seconds since 1582) instead of dates. Export to XLSX with a tool that converts them, or convert the column in your own code.

Can TRTT convert .zsav or .por files?

Not directly yet. The TRTT engine can read compressed .zsav files, but the web and iOS apps currently open files with the .sav extension only. Older portable .por files aren't supported in the apps. R (haven) and Python (pyreadstat) read .zsav; haven can also read .por.


TRTT is an independent product. It is not affiliated with or endorsed by IBM. IBM and SPSS are trademarks of International Business Machines Corporation.

More in Guides