What is the DTA file format?
Files with the .dta extension are most commonly Stata Data Files - the native dataset format created by StataCorp LLC - though .dta is also used as a generic extension by a handful of other applications for storing data. A .dta file can contain various types of statistical information, depending on the application that produced it.
The Stata .dta format dates back to Stata 1.0 (1985), with internal format versions 104-121 mapping to Stata releases 8 through 19. Data stored in .dta files is saved in a structured binary format. Modern files (format 117 and later, produced by Stata 13+) use an XML-tagged binary layout and begin with the literal ASCII signature <stata_dta> at byte zero, making them straightforward to identify. Older files (formats 104-115) carry no ASCII signature - the first byte encodes only the numeric format-version identifier.
Each .dta dataset holds a rectangular table of variables (columns) and observations (rows). Every variable carries a name, storage type, display format, and an optional label, and the file may also include dataset-level metadata such as a timestamp, sort-variable list, value-label dictionaries, and user-defined characteristics. Supported numeric types include byte, int, long, float, and double; string types range from fixed-width str1-str2045 to the variable-length strL (up to ~2 billion characters, available in format 117+).
Beyond Stata itself, .dta files are broadly interoperable and can be opened or converted using free tools:
Security & safety
RISK: LOWA Stata .dta is passive data - it contains no executable code, so opening one in a viewer is safe. The realistic cautions are non-malware: datasets can carry confidential/personal data (anonymise before sharing), and value/variable labels are easy to lose when exporting to CSV. Browser viewers like PondPilot process the file locally, but verify that before uploading sensitive research data anywhere. Beware fake "DTA viewer/repair" download sites that bundle adware - prefer the free readers listed here.
Format details
in a nutshell- Turbo Pascal data table - Borland Turbo Pascal stored data tables as .dta, readable only by that legacy environment.
- Generic game / application data - Some games and apps use .dta as a plain 'data' suffix for their own files, opened only by the originating program.
Programs that open DTA files
Technical details
deep spec| Format type | Proprietary binary statistical dataset |
| Primary developer | StataCorp LLC |
| Internal format versions | 104-121, corresponding to Stata releases 8 through 19 |
| Magic signature | ASCII text "<stata_dta>" at byte offset 0 (format 117+, Stata 13 and later); no ASCII signature in older formats 104-115 |
| MIME type | application/x-stata-dta |
| Character encoding | UTF-8 in format 118+ (Stata 14+); ASCII in earlier versions |
| Data layout | Rectangular: one row per observation, one column per variable |
| Supported storage types | byte, int, long, float, double; str# fixed-width strings up to str2045; strL variable-length strings (format 117+) |
| Variable metadata | Name, storage type, display format, variable label, and value-label dictionary name stored per variable |
| Dataset metadata | Timestamp, sort-variable list, value-label dictionaries, and user-defined key-value characteristics |
| Endianness | Little-endian in format 117+; earlier versions supported both little-endian and big-endian byte orders |
| Compression | Uncompressed by default; optional zlib compression introduced in format 121 (Stata 18) |
| Maximum variables | 2,047 (Stata/IC); 32,767 (Stata/SE); 120,000 (Stata/MP) |
| Interoperability | Readable by R (haven package), Python (pyreadstat / pandas), PSPP, and SAS (PROC IMPORT) |
| Cross-platform availability | Windows, macOS, and Linux; format 117+ files are byte-order-portable across all platforms |
| Released | Stata .dta since Stata 1.0 (1985); format versions 104-121 map to Stata 8-19 |
| Open standard | Yes · royalty-free |
| Specification | www.stata.com |
DTA conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about DTA files.