Scientific data often arrives in a format only MATLAB or Python can open: a .mat file from a colleague, an HDF5 file from an instrument or simulation, a NetCDF file of climate or ocean data. This viewer opens all three in the browser, so a file can be checked or its numbers taken out without installing anything - no MATLAB licence, no Octave, no Python environment with scipy and h5py. That matters for unpublished results, patient or participant data and anything under a data agreement: online converters that turn a .mat into text work by uploading it.
MATLAB figures (.fig) and live scripts (.mlx) open here too. A saved figure is drawn again from the graphics objects inside it, so you can see a colleague's plot, save it as PNG or SVG, and take the plotted numbers out as CSV. A live script is shown as MATLAB's Live Editor lays it out - text, equations, code and the outputs saved with it - and can be downloaded as a plain .m file.
MATLAB files saved up to version 7, and version 4 files, are read by this site's own readers, written from MathWorks' published format; version 7.3 files are HDF5 inside. HDF5 and NetCDF-4 files are read with h5wasm, the HDF5 library compiled for the browser by the US National Institute of Standards and Technology (NIST), and only the parts needed are read, so even very large files open quickly. Classic NetCDF files - CDF-1, CDF-2 with 64-bit offsets and CDF-5 with 64-bit data - are read by this site's own reader, written from Unidata's format specification.
You do not need to know: the viewer reads the file's header and shows beside the file name whether it is level 5 (what versions 6 and 7 write), 7.3 or version 4. For reference, MATLAB's save writes version 7 by default (compressed, up to 2 GB per variable), -v6 writes the same layout uncompressed, -v7.3 writes an HDF5 file for larger variables, and -v4 writes the old format still produced by some instruments and simulation tools. Version 7.3 files open in HDF5 tools too; the others are MATLAB's own format.
- Do I need MATLAB to open a .mat file?
- No. Files saved by MATLAB's save command - with the default version 7, older version 6, or -v7.3 - open here directly, as do .mat files written by Python's scipy and Octave, and old version 4 files (save -v4). Objects MATLAB keeps in a hidden part of the file (string arrays, tables, datetimes) are listed but not shown.
- Can it open very large HDF5 files?
- Yes. An HDF5 file (including NetCDF-4 and MATLAB 7.3) is read in place: only the variables and slices you look at are loaded, so a file of many gigabytes opens as quickly as a small one. MATLAB files up to version 7 (and version 4) and classic NetCDF files are read whole, up to 1.5 GB. Views of more than a million values are thinned evenly for display.
- How do I convert a MAT file to CSV?
- Open it, choose the variable, and press Save view as CSV. A matrix becomes rows and columns as in MATLAB, numbered from 1; a 3-D array is saved one 2-D slice at a time, the one the sliders point at; a sparse matrix is saved as its non-zero entries, with row, column and value; for a struct, choose each field in the tree and save it on its own. Numbers are written with every digit needed to read back exactly the same value, long integers included, and single-precision data is written as the value it holds. Complex numbers are written as 3-4i. A view of more than a million values is thinned evenly, and the page says so, so for one that large choose a smaller slice.
- Can I open a .mat file from Python or Octave here?
- Yes. Files written by scipy.io.savemat, by hdf5storage or h5py in MATLAB 7.3 layout, and by Octave's save -mat7-binary or -v7 open like MATLAB's own. A file saved by Octave in its text format, or a Python pickle renamed .mat, is not a MAT-file and is refused with a message.
- Why is a variable listed but not shown?
- MATLAB keeps some classes - string arrays, tables, timetables, datetimes, categoricals and other objects - in a hidden, undocumented part of the file, and function handles are stored as code references rather than data. Those are listed with their size and class, but their values cannot be read. To get at them, convert them in MATLAB before saving, for example with table2array, cellstr or datenum.
- Which compression does it read?
- All the usual ones: HDF5's own deflate (gzip), shuffle and SZIP, MATLAB's compression, and the add-on HDF5 filters used by h5py, hdf5plugin, PyTables and many instruments - Blosc, Blosc2, bitshuffle, LZ4, LZF, Zstandard, bzip2, ZFP, JPEG, BitGroom and BitRound. A decoder is downloaded only when a file needs it.
- How do I open a .fig file without MATLAB?
- Drop it here. A MATLAB figure file is a MAT-file holding the figure's graphics objects, and this page draws them again: axes and subplots, lines, scatter plots, bars, areas, stems, stairs, error bars, histograms, patches, images and surfaces (as a colour map, or in 3-D as a flat projection), contours, text, titles, legends and colour bars, with their colours, line styles, markers, limits and log scales. Figures from MATLAB 5 onwards open, including large ones saved in the 7.3 format and GUIDE app layouts. A few things cannot be drawn: lines made by fplot keep their formula rather than their points, and figures saved with savefig's compact option keep only a form MATLAB alone reads; the page says what it left out.
- Can I get the data out of a MATLAB figure?
- Yes. Save data as CSV writes each plotted series with its x, y and z values at full precision (error bars with their lengths, histograms with their bin edges, images and surfaces as a grid), one CSV for a single series and a ZIP of CSV files for several. It is the data saved in the figure, not numbers read off the picture.
- Can I open an .mlx live script without MATLAB?
- Yes. The live script's text, headings, lists, tables, pictures and equations are shown with its code, coloured as in MATLAB, and the outputs saved with it - figures, printed text, variables and warnings - under the code that made them. Nothing is run, so a script saved without its outputs shows text and code only. Download as .m saves the code with the text as comments, as MATLAB's Save as .m does, and Print or save as PDF makes a printable copy.
- Why does my .fig file not open?
- .fig is used by other programs too. A Figma design file and a drawing from Xfig are both called .fig but are not MATLAB figures; the page tells you which one you have and what opens it. A MATLAB figure always starts with a MAT-file header, which this page checks first.