XPT to CSV

Open a SAS transport file as CSV or as an Excel workbook. Useful for checking a submission dataset, or for anyone who received an .xpt and has no SAS.

Options
Options
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.
Helps Excel read accents and other scripts correctly when the file is double-clicked. Turn it off for tools that trip over it.
Text that starts with =, +, -, @ or a tab gets a leading apostrophe, so Excel shows it as text instead of running it. Numbers are never changed.

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?

Clinical datasets, even pseudonymised ones, aren't something to email to a free web service. The .xpt is read entirely by the browser on this computer, with no copy sent out.

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.

The format regulators ask for

XPT, or SAS XPORT, is SAS's transport format: a plain, openly documented layout meant for moving datasets between systems. That openness is why the US FDA asks for study data in version 5 transport files. Sponsors and CROs ship SDTM domains (dm.xpt, ae.xpt, lb.xpt) and ADaM datasets (adsl.xpt) this way, and public data such as the CDC's NHANES survey is published as .xpt too.

So an .xpt ends up with data managers, medical writers, statisticians on R, and students working through NHANES. The converter reads version 5 and version 8 transport files.

What comes out

CSV output gives three files: the data, a variables file and a value labels file. In a version 5 file variable names are at most 8 characters, so the label column of the variables file is where "Analysis Visit" hides behind AVISIT. Excel output puts the same three tables on Data, Variables and Value labels sheets.

The value labels file stays empty apart from its header. Like every SAS dataset, an .xpt keeps codes as plain values and leaves the labels to formats stored elsewhere. In SDTM and ADaM work the meaning of each code is written down in the define.xml and the controlled terminology, which aren't read here.

Dates, missing values, size

Date variables with a SAS date format (DATE9., E8601DA. and similar) become 2024-03-01 with "Readable dates". In SDTM most dates are ISO 8601 text already (--DTC variables), and those pass through untouched. Numeric missing values are empty cells; set Missing values to "Keep the stored code" if the special ones (.A to .Z) mean something in your data.

Transport files are uncompressed and so bigger than the same data elsewhere. Up to 200 MB is accepted on a computer, less on phones. Excel output stops at around 3 million data cells; CSV doesn't.

Questions about this format

How do I open an XPT file without SAS?

Convert it here to CSV or Excel and open that. In code, R (haven::read_xpt) and Python (pandas.read_sas) read .xpt directly.

Can I open NHANES .xpt files in Excel?

Yes. Pick Excel XLSX as the output and open the workbook. The Variables sheet carries the labels that explain short NHANES names like RIDAGEYR.

Does this check FDA submission compliance?

No. It reads and converts the data; it doesn't validate against SDTM, ADaM or the FDA's technical rules. Use a dedicated validator for that.

Is XPT the same as SAS7BDAT?

Both hold SAS datasets. SAS7BDAT is the native working format; XPT is the transport format for exchange and archiving. Both convert here, each on its own page.

Last updated: