MATLAB .mat to CSV Converter

Drop in a MATLAB .mat file to list its variables, preview one as a table, and export it to CSV — no MATLAB, Octave, or upload required.

Drop a .mat file here, or click to choose
MATLAB data files (.mat, v5/v6/v7) — processed entirely on your device

How this works: this page parses the MAT-file level 5 binary format (the format MATLAB calls v5, v6, and v7) directly in your browser tab, including the zlib-compressed variables MATLAB writes by default — the file is read with the File API and never uploaded anywhere.

MATLAB v7.3 files are HDF5-based and use a completely different container format under the hood; this page detects them and tells you, but doesn't parse them yet. Re-save as v7 in MATLAB (save("file.mat","-v7")) first, or use Python's h5py/scipy for v7.3 files directly.

Cell arrays, struct arrays, sparse matrices, and function handles aren't supported for CSV export — plain numeric, logical, and character (string) variables are. N-dimensional arrays (more than 2 dimensions) also aren't supported; only 2-D matrices and vectors export.

Troubleshooting

"This is a MATLAB v7.3 file" message

Starting around MATLAB R2006b, save can write v7.3 files, which switch the container format entirely to HDF5 — a different binary layout this page doesn't parse. In MATLAB, re-save with save("file.mat","-v7") to get a format this page can open, or use Python's h5py or scipy.io to read a v7.3 file directly.

A variable shows as "not supported for CSV export"

Cell arrays, struct arrays, sparse matrices, and function handles don't map cleanly onto a flat CSV grid, so this page skips them and shows the variable's class instead. Plain numeric matrices, logical arrays, and character arrays (strings) all export normally.

A variable shows as a "3-D array" (or higher) that isn't supported

CSV is inherently a 2-D format. If a variable has more than 2 dimensions, export a 2-D slice of it instead — in MATLAB, something like squeeze(myArray(:,:,1)) before saving.

Prefer the command line?

python -c " import scipy.io as sio d = sio.loadmat('file.mat') d['myvar'].tofile('out.csv', sep=',') "

SciPy's scipy.io.loadmat reads the same v5/v6/v7 format this page does (it does not read v7.3 either — that needs h5py). Octave, MATLAB's free-software counterpart, can also open and re-save a .mat file if you have it installed.