DTA to Excel

Stata dataset in, Excel workbook out. The data sits on the first sheet, with the variable list and the value labels on two more, so nothing has to be looked up in Stata later.

Convert toExcel XLSX
Options
Options
Write the label stored for a code (1 becomes "Male") or keep the numeric code. The value labels list is included either way.
User-defined (SPSS) and extended missing values (Stata .a, SAS .A) can be left empty like system-missing values or kept as stored.
Readable dates such as 2024-03-01 (real dates in Excel), or the numbers the file stores, e.g. seconds since 1582 in SPSS.

Your file is converted on your computer. It is not uploaded anywhere.

How it works

  1. Drop your file in the box above, or click it to pick one.
  2. Pick the output format and press Convert.
  3. Download the result. Nothing was uploaded on the way.

Is it safe?

Panel surveys and administrative extracts in .dta form often come with strict storage rules. Converting here keeps the file inside your browser; no server ever sees a row of it.

Want to check? Open your browser DevTools, switch to the Network tab and convert a file. Or convert a small file once, because each converter downloads its code the first time, then go offline and convert your real file.

What's on each sheet

  1. Data - the observations. Labelled variables show their labels unless you set Coded values to "Numeric codes". %td dates and %tc date-times are real Excel dates; monthly, quarterly, half-yearly and weekly periods are written as text such as 2024-03 or 2024-Q1, because Excel has no type for them.
  2. Variables - name, variable label, storage type (numeric, or string with its width) and Stata display format such as %9.0g or %td.
  3. Value labels - every label set, unrolled into one line per code and variable.

Want separate files instead of one workbook? DTA to CSV writes the same three tables as CSV.

Datasets that are too wide or too long for Excel

Stata happily handles tens of thousands of variables and millions of observations. Excel doesn't: one sheet is capped at 16,384 columns and 1,048,576 rows. On top of that the workbook is assembled in your browser's memory, so this converter draws the line at around 3 million data cells, for example 60,000 observations of 50 variables. Past that it stops with a message and points you to CSV rather than handing over a half-empty workbook. Files up to 200 MB are accepted on a computer; phones get a smaller cap.

Who sends .dta files to Excel users

Usually a research team. The analyst works in Stata, the people around them don't: a programme manager who wants the raw numbers, a funder asking for the dataset, a reviewer checking a replication package. A workbook with the labels already filled in is the friendliest thing to pass on.

Gaps to know about

Extended missing values (.a to .z) are blank cells by default; "Keep the stored code" under Missing values keeps them as .a, .b and so on. Notes stored with the dataset aren't included, and neither are characteristics or Stata's sort order. Text longer than Excel's 32,767 characters per cell is cut, with a note saying how many values were affected.

Questions about this format

How do I see Stata value labels in Excel?

Leave Coded values on "Value labels" and the Data sheet shows the label text in each cell. The complete list of codes and labels is on the Value labels sheet as well.

Why are some date columns text instead of dates?

Those are Stata period formats like %tm or %tq. A month or a quarter is not a calendar day, so they are written as 2024-03 or 2024-Q1. Dates before 1900 are text too, since Excel cannot show them.

Can I open a .dta file in Google Sheets?

Not as it is. Convert it to XLSX here and upload that workbook to Google Sheets, or import the CSV version.

Last updated: