How to open a SAS .xpt file
XPORT (.xpt) is the open SAS format that travels outside SAS: the FDA requires it for study data, and the CDC publishes NHANES survey data in it. Without SAS you usually need R or Python to look inside. Here an .xpt opens in the browser as a table.
Free to use. Read in your browser; the file is not uploaded. Windows version — 4.9 MB, no installation: details. Pro — $29 once: price.
What is read
- XPORT version 5 — the one the FDA and CDISC submissions use (8-character names, 40-character labels) — and version 8/9 with long names and labels.
- Several datasets in one file: the first opens, the others are picked in Parsing → File parsing.
- Numbers are stored in the old IBM mainframe format; they are converted to ordinary numbers, including shortened (2–7 byte) numeric variables.
- Missing values
.,._and.A–.Zare empty cells. - Dates: variables with DATE, MMDDYY, YYMMDD, E8601DA and similar formats become dates; DATETIME and E8601DT become date and time; TIME is shown as hh:mm:ss.
- Variable labels appear next to the names in the Fields panel.
NHANES and clinical data
NHANES files (DEMO_L.XPT, BMX_L.XPT and the rest) open directly: drop the file, filter by age or by survey cycle, export to Excel. SDTM and ADaM datasets (dm.xpt, adsl.xpt) open the same way — handy for a quick look at a submission package without a SAS session. To join two domains by USUBJID or SEQN, see linking two tables.
What about .sas7bdat?
Honestly: .sas7bdat, SAS’s own dataset format, is not read yet. It is a closed format, and the app tells you so instead of showing garbage. What to do:
- In SAS:
proc export data=lib.ds outfile='ds.csv' dbms=csv; run;— or write a transport file with thexportengine or the%loc2xptmacro. - Without SAS, with R:
haven::write_xpt(haven::read_sas("ds.sas7bdat"), "ds.xpt"); with Python:pandas.read_sas("ds.sas7bdat").to_csv("ds.csv").
The resulting .xpt or CSV opens here.
Formats and value labels
In SAS, value labels live in user formats, stored in a separate catalog (formats.sas7bcat), not in the dataset. An .xpt therefore holds the codes only, and that is what you see. The format names are used just to recognise dates.
FAQ
Can I open NHANES .XPT files?
Yes. They are XPORT version 5 files and open directly; export to Excel or CSV in one step (the free edition exports up to 5,000 rows at a time).
Is .sas7bdat supported?
Not yet. Convert it to .xpt or CSV in SAS, R or Python first — the commands are above.
Can I save changes to .xpt?
No, viewing only. Export the table to Excel, CSV or Parquet.
Does the file go to a server?
No. The file is parsed in your browser tab — important for clinical data.
Free to use. Your file is not uploaded to a server. Windows version — 4.9 MB, no installation: details. Pro — $29 once: price.