Why convert DTA to XLSX?
Stata .dta is a proprietary binary format that requires a paid licence to open natively, while .XLSX opens in Excel, Google Sheets, and any modern spreadsheet. Converting to XLSX is the standard way to share a Stata dataset with collaborators who use Excel.
How to convert DTA to XLSX
Python + pandas OPEN-SOURCE
Install pandas and openpyxl, then load with pd.read_stata('data.dta') and write with .to_excel('data.xlsx', index=False); verify that convert_categoricals=True is active for readable label text.
Stata APP
Open the .dta in Stata and run export excel with the firstrow(variables) option in the Command window to write the XLSX file with column headers.
About these formats
A DTA file is almost always a Stata dataset - the native binary format of the StataCorp Stata statistics package. You do not need a paid Stata licence to open one: PondPilot opens it free…
Open .DTA details →An XLSX file is a Microsoft Excel spreadsheet saved in the Open XML format, introduced with Excel 2007 as the replacement for the older binary XLS format. You can open it without buying…
Open .XLSX details →Quality & what to watch
- Value labels (e.g. 1 = Male) may export as numeric codes depending on the tool - verify categorical columns in the output before sharing.
- Variable labels are metadata not supported by XLSX and are dropped unless manually added as a separate row or sheet.
- Excel holds 1,048,576 rows per sheet; large datasets may exceed this limit.
Frequently asked questions
Do I need a Stata licence to export DTA to XLSX?
How are Stata date variables represented in the XLSX?
Why are my categorical columns showing numbers in Excel?
convert_categoricals=True is active in pandas to decode them to text.