CSV Tools

Convert HDF5 to CSV

How to convert HDF5 (.h5 / .hdf5) datasets to CSV — find the dataset in your browser, then export it free

MATLAB .mat files saved with -v7.3 are HDF5 in disguise — the MAT guide covers that case. For formats we convert instantly in the browser, see all of our CSV converters.

HDF5 (.h5 or .hdf5 — same format, different extension) isn’t a table, it’s a container: datasets organized into groups, like folders within a single file. That means “convert to CSV” really means “pick a dataset and export it” — one HDF5 file can yield several CSVs. There’s no in-browser converter for this format here yet; the free two-step route below works for any HDF5 file. Python users can jump straight to that section.

No installation: find the dataset, then export it

Step 1: Find your dataset path with myHDF5

Go to myhdf5.hdfgroup.org — the HDF Group’s free in-browser viewer. It runs entirely client-side (your file is never uploaded), so it’s safe even for confidential data. Open your file, browse the tree, and note the path of the dataset you want, e.g. results/temperature.

Step 2: Export it with Google Colab

  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 .h5 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 h5py
import pandas as pd

with h5py.File("yourfile.h5", "r") as f:
    f.visit(print)  # lists every dataset path — handy if you skipped step 1
    data = f["results/temperature"][()]  # replace with your dataset path

pd.DataFrame(data).to_csv("output.csv", index=False)

Unlike myHDF5, Colab does put the file on Google’s servers (in a temporary private session that disappears when the tab closes) — for confidential data use HDFView below instead.

Free desktop app: HDFView

HDFView is the HDF Group’s official free desktop browser (Windows/macOS/Linux, from hdfgroup.org). Open the file, double-click a dataset to view it as a table, then use Table → Export Data to Text File. Note the output is a delimited text file rather than a ready-made .csv — fine for a quick look, but the Colab route gives you a cleaner CSV.

Python

Two cases, and mixing them up is the usual failure:

  • The file was written by pandas (df.to_hdf(...)): read it back with pandas.read_hdf().
  • Any other HDF5 file (instruments, simulations, other languages): read_hdf will fail — use h5py, list the dataset paths, and pick one.
import pandas as pd

df = pd.read_hdf("data.h5")  # pandas-written files only
df.to_csv("output.csv", index=False)

For generic files, use the h5py snippet from the Colab section — it’s identical locally (pip install h5py pandas first).

R

rhdf5 exists on Bioconductor, but unless you’re already in that ecosystem the install friction isn’t worth it — use the Colab route instead.

Which method should I use?

Your situationBest method
No software installed, one file, data not confidentialmyHDF5 + Google Colab
Confidential data that can’t leave your computermyHDF5 (view) + HDFView (export)
Many files or datasets, or a task you’ll repeatPython with h5py

FAQ

4 questions
How do I see what's inside an .h5 file?
Open it at myhdf5.hdfgroup.org — a free official viewer that runs entirely in your browser, so the file never leaves your machine. In Python, open the file with h5py and call f.visit(print) to list every dataset path.
Is there a difference between .h5 and .hdf5 files?
No. Both extensions mean the same HDF5 format; .h5 is just the shorter convention. Every tool in this guide handles either.
Why does pandas.read_hdf() fail on my file?
pandas.read_hdf() only reads HDF5 files written by pandas itself (the HDFStore/PyTables layout). For a generic HDF5 file from an instrument, simulation, or another language, use h5py instead: open the file, pick a dataset path, and pass the array to pandas.
Can Excel open HDF5 files?
No. Excel has no HDF5 importer. Export the dataset you need to CSV first — via Colab, HDFView, or Python — then open the CSV in Excel.

More Format Guides & Converters

6 pages

More Convert File Formats Tools

23 tools