CSV Tools

Convert SAS7BDAT to CSV

How to convert SAS (.sas7bdat) files to CSV — free methods, no SAS license required

We don't have an in-browser converter for this format yet — the guide below covers every free route instead. For formats we convert instantly, browse all of our CSV converters.

A .sas7bdat file is a SAS dataset — the native table format of SAS, the statistics platform used across pharma, government, and research. A SAS license costs thousands, but you don’t need one to get your data out. There’s no in-browser converter for this format here yet, so this guide covers the free routes that actually work. Fastest option with no software: the Google Colab recipe below. If you already use Python or R, jump to those sections.

No installation: convert in Google Colab

This route needs nothing but a browser and a Google account — it works on a Chromebook or a library computer.

  1. Open Colab — Go to colab.research.google.com, sign in with any Google account, and click New Notebook.
  2. Upload your file — Click the folder icon in the left sidebar, then the upload button, and select your .sas7bdat file.
  3. Run the code — Paste the snippet below into the cell and press the run button.
  4. Download the result — Refresh the file sidebar, right-click output.csv, and choose Download.
import pandas as pd

df = pd.read_sas("yourfile.sas7bdat")  # replace with your uploaded filename
df.to_csv("output.csv", index=False)

read_sas is built into pandas, so there’s nothing to install. Your uploaded file lives in a temporary private session that disappears when you close the tab — but it is on Google’s servers, so for confidential data use a desktop option below instead.

Free desktop apps (no code)

SAS Universal Viewer

The official free viewer from SAS itself (Windows only, download from support.sas.com). Open your dataset with File → Open, then use the Table menu → Save As and pick CSV as the file type. Being an official SAS tool, it’s the safest bet for files that other readers choke on.

jamovi

A free, cross-platform statistics app that imports .sas7bdat (and .xpt) files directly. Open the file in jamovi, then export the data as CSV. The better choice if you also need to run analyses on the data afterward, since you can do that without ever leaving the app.

Python

The pandas call is one line, with no extra packages needed:

import pandas as pd

df = pd.read_sas("data.sas7bdat")
df.to_csv("output.csv", index=False)

If the output contains garbled text, the file was written with a legacy encoding — this is THE common failure with older SAS files. The fix:

df = pd.read_sas("data.sas7bdat", encoding="latin1")

The same read_sas call also reads .xpt (SAS transport) files, so no separate tooling is needed for those.

R

The haven package reads SAS datasets directly:

install.packages("haven")  # first time only
df <- haven::read_sas("data.sas7bdat")
write.csv(df, "output.csv", row.names = FALSE)

Which method should I use?

Your situationBest method
No software installed, one file, data not confidentialGoogle Colab
Confidential data that can’t leave your computerSAS Universal Viewer or jamovi
Many files, or a task you’ll repeatPython or R

FAQ

4 questions
Can I open a .sas7bdat file without SAS?
Yes. SAS Universal Viewer (the official free viewer from SAS, Windows only), jamovi (free, cross-platform), and pandas in Google Colab can all open .sas7bdat files without a SAS license. All three can get you to a CSV.
What is the difference between .sas7bdat and .xpt files?
.sas7bdat is the native SAS dataset format. .xpt is the SAS transport format, designed for exchanging data between systems (it is the format required for FDA submissions). pandas.read_sas() reads both, so the same conversion code works either way.
Why does my converted CSV contain garbled characters?
The file was probably written with a legacy character encoding. Pass encoding='latin1' to pandas.read_sas() — for example pd.read_sas('data.sas7bdat', encoding='latin1') — and the text should come out clean. This is the most common failure when converting older SAS files.
Can Excel open .sas7bdat files?
No. Excel has no importer for SAS datasets. Convert the file to CSV first using any method in this guide, then open the CSV in Excel.

More Format Guides & Converters

6 pages

More Convert File Formats Tools

23 tools