Skip to content
TaskNinja

HomeToolsMAT File ViewerMAT to CSV

MAT to CSV

MAT to CSV turns the variables in a MATLAB .mat file into CSV files or an Excel workbook, made in this browser without MATLAB.

MatOpenFreeNo signupOn your device
Opening the tool…

What this tool does

Convert MATLAB .mat files to CSV or Excel in your browser, without MATLAB. One variable or all of them in a ZIP. Tables and structs too. No upload.

How to use it

  1. Choose the .mat file. Nothing is uploaded.

  2. Tap the variable you need in the list and check its values on screen.

  3. Press Download CSV for that variable, All variables as CSV (ZIP) for one CSV per variable, or Excel for a workbook with a sheet per variable.

Common uses

In MATLAB the usual answer is writematrix or writetable, which needs MATLAB. In Python it is scipy.io.loadmat plus pandas, which needs a working install and some code, and still fails on -v7.3 files and on tables and strings. When all you need is the numbers in a spreadsheet, that is a lot of setup.

Each CSV is made from the variable as MATLAB stores it. A matrix becomes rows and columns. A vector becomes one column. An N-D array is written page by page with a label line such as data(:,:,2). Complex values are written as a+bi, logical values as 0 and 1, and int64 values with every digit. Numbers keep full double precision.

A MATLAB table or timetable becomes a CSV with a header row of its variable names, the row names or row times in the first column, and multi-column variables split into name_1, name_2. A struct array becomes one row per element and one column per field. A scalar struct becomes a list of field and value. A sparse matrix becomes row, column and value, like MATLAB's find.

The ZIP holds one CSV per variable named after it, so a whole workspace moves into Python, R or a spreadsheet in one step. The Excel workbook has a Variables sheet first and one sheet per variable after it.

The CSV files are UTF-8 with a byte order mark, so Excel shows non-English text correctly, and they open in Google Sheets, LibreOffice, pandas and R without any settings.

Common cases: a lab sends sensor data as a .mat file and the report is written in Excel; a thesis supervisor shares a workspace from years ago; a Kaggle or university dataset is only offered as .mat; a Simulink run logged its signals and the test team wants them in a spreadsheet. In each case the variable names in the file become the CSV file names and column headings, so nothing has to be retyped.

Check the numbers on screen before you export. The table pages through every row and column, and vectors and narrow matrices are plotted, so a wrong variable or a transposed matrix is easy to spot. Files saved by MATLAB 4 through the latest release, by GNU Octave and by Python all convert the same way.

Private, and the limits

The CSV, ZIP and Excel files are made by code in this browser tab. The .mat file is never sent to TaskNinja or any other server.

The export holds the data saved in the file. Function handles and objects the viewer cannot read are written as a short description.

Official sources

Last checked 2026-11-18.

FAQ

How do I convert a .mat file to CSV without MATLAB?
Choose the file here, tap the variable and press Download CSV. For every variable at once, press All variables as CSV (ZIP).
Can I convert a .mat file to Excel?
Yes. Press Excel (all variables) for an .xlsx workbook with one sheet per variable and a Variables sheet that lists them all.
Does it work with -v7.3 files?
Yes. Numbers, text, logical, cell arrays, structs and sparse matrices in -v7.3 files convert. Class objects such as tables in -v7.3 files are listed but not converted yet.
Are the numbers rounded?
No. CSV and Excel keep full double precision. Only the table on screen rounds long numbers to 7 digits so they fit.
What happens to a struct or a cell array?
A struct array becomes one row per element with a column per field. A cell array becomes a grid where small values are written out and bigger ones are described by size and class; open them on screen to export them on their own.
Does it work on a phone?
Yes. Pick the .mat file from the Files app on iPhone or from Downloads on Android. The CSV, ZIP or Excel file is saved to the phone.
Can I convert CSV back to .mat?
Not on this page. It reads .mat files and exports them.

Related tools

MAT File ViewerMATLAB FIG to CSVJMP to CSVAll tools