Markdown Table to CSV
Paste a Markdown table or upload a .md file. The first table is parsed and downloaded as CSV, entirely in your browser.
How to use the Markdown to CSV Converter
- Paste a Markdown table into the text box, or click Upload .md file to load a .md, .markdown or .txt file.
- Check the preview. It shows the number of columns and rows found and the first 5 data rows.
- If no preview appears, make sure the table has a header row followed by a separator row such as |---|---|, with the same number of cells in both.
- Click Download CSV to save the table as table.csv.
Worked example
A price list copied from a README, including a line of text above the table.
Input (Markdown)
Q3 price list:
| Product | Price | Notes |
|:--------|------:|-------|
| Widget | 4.50 | Blue, small |
| Gadget | 12.00 | Says "new" |
| Gizmo | 0.99 | **Clearance** |Output (table.csv)
Product,Price,Notes
Widget,4.50,"Blue, small"
Gadget,12.00,"Says ""new"""
Gizmo,0.99,**Clearance**The line of text above the table is ignored because it is not part of a table. The alignment colons in the separator row are dropped. Cells that contain a comma or a double quote are wrapped in quotes, and inner quotes are doubled. Values are copied as text, so 4.50 stays 4.50. Markdown formatting such as **bold** is kept as literal characters.
How Markdown table parts map to CSV
- The header row of the first table becomes the CSV header row. Text before the table is ignored.
- The separator row is checked and then skipped. Left, right and center alignment is not stored in CSV.
- Every row after the separator becomes one CSV row, up to the end of the table. Spaces around each cell are trimmed.
- Every row has the same number of fields as the header. Short rows are padded with empty fields and extra cells are dropped.
- An escaped pipe (\|) stays inside the cell as a plain | character.
Frequently Asked Questions
What Markdown table format does this support?
Pipe tables, as used by GitHub, GitLab and most Markdown editors. The table starts at a header row that is followed by a separator row made of dashes, with optional colons for alignment. The header and separator must have the same number of cells.
My table has no pipes at the start and end of each row. Will it work?
Yes. Leading and trailing pipes are optional, as in GitHub Markdown. A line like Name | Age works once a valid separator row such as --- | --- follows the header. Rows with and without outer pipes can be mixed in one table.
Can I convert a file with several tables?
The tool converts the first table it finds. The table ends at the first blank line, the first line without a pipe, or the start of another table. Any later tables are ignored, so their headers never end up as data rows. To convert a later table, paste it on its own.
How do I open the CSV in Excel or Google Sheets?
Download table.csv and open it directly in Excel, or use File, Import in Google Sheets. The file uses commas as separators and standard double-quote escaping, so both read it correctly.
Is my data uploaded?
No. The table is parsed with JavaScript in your browser, and the CSV file is created on your device.
Related tools
HTML Table to CSV
Extract the first table from HTML and save it as CSV.
CSV to Markdown
Go the other way: turn a CSV file into a Markdown table.
Markdown Preview
Render Markdown to check how a table will look.
CSV Viewer
Open the CSV you just made and browse it as a table.
CSV to Excel
Convert the CSV into an .xlsx workbook.
CSV to JSON
Turn the rows into a JSON array of records.