statfile.tools

SPSS .sav vs Stata .dta

SPSS .sav and Stata .dta files solve the same problem in similar ways: both store a rectangular dataset together with the labels and metadata that give it meaning. The differences are in the details, and they matter when you are converting between them.

What they have in common

Both formats store data as a case-by-variable matrix and attach a metadata dictionary on top. In both, every variable can carry a descriptive label, and categorical variables can carry value labels that map codes to text. Both record per-variable display formats, including special handling for dates. And both are binary, proprietary formats that their parent software writes and reads natively.

This shared structure is why a single viewer can present either format the same way: a data grid for the values, and a variable grid for the dictionary.

Where they differ

Missing values are the clearest difference. SPSS distinguishes a single system-missing value from user-defined missing values that you declare per variable. Stata instead provides 27 distinct missing codes (a plain dot and .a through .z), letting analysts record why a value is absent.

Storage typing differs too. Stata exposes explicit numeric types (byte, int, long, float, double) and string types, choosing the smallest that fits. SPSS keeps numbers as 8-byte doubles and distinguishes only numeric from string, with width and decimal settings handled through display formats. Dates are counted from different origins — SPSS from 14 October 1582, Stata from 1 January 1960 — so any converter has to translate the epoch, not just copy the number.

Converting between them

Because the two formats carry the same kinds of information, converting the data itself is straightforward: export one to CSV, Excel, or JSON and import it into the other. The subtle part is the metadata — labels, value labels, and especially missing-value semantics — which a values-only format like CSV cannot hold. When the labels matter, exporting to Excel (which keeps a dictionary sheet) or generating a codebook preserves them in a readable form.

Frequently asked questions

Can I convert a .sav file to a .dta file?+

Yes — statfile.tools converts directly between the two formats in your browser, carrying variable labels, value labels, and dates across. Use the .sav to .dta converter, or .dta to .sav for the reverse direction.

Which format is better?+

Neither is universally better; the choice usually follows whichever software a research group uses. The formats store equivalent information with different conventions for typing and missing values.

Convert this format