How to convert a Markdown table to CSV
To convert a markdown table to csv, paste the table and read the result. The tool finds the header line and the separator line made of dashes, splits each row at the pipes, and writes one CSV line per row. The separator line is dropped, and so are the alignment colons. This input:
| Tool | Status | Notes |
|:-----|:------:|------:|
| **chmod** | [live](https://example.com/chmod) | Handles `a|b` and a \| pipe |
| _cron_ | live | Line one<br>line two |gives this CSV with the default settings:
Tool,Status,Notes
chmod,live,Handles a|b and a | pipe
cron,live,Line one line twoThe bold and italic marks are gone, the link is reduced to its text, the escaped pipe and the pipe inside the code span stay in their cells, and the line break became a space.
Several tables in one document
A README or a chat answer often holds more than one table. Every table in the pasted text is listed under Tables found, with the line it starts on, so you can tell them apart. Choose the one you want, or All tables for one result with an empty line between the tables. A CSV file holds a single table, so convert them one at a time when you need separate files.
Tables inside fenced code blocks, the ones between triple backticks, are skipped by default, because they are usually examples of the syntax. Turn on Include tables in code blocks under More options to read them as well.
Escaped pipes, code and rows that do not match
A pipe ends a cell, unless it is escaped with a backslash. The tool turns \| back into a plain pipe. A pipe inside a code span is treated as part of the code and stays in the cell. GitHub splits the cell there instead, so a table that relies on that looks different on GitHub. Set Pipe inside code to Splits (GitHub) to match it.
The separator line must have as many cells as the header line, as the GitHub rules require. Outer pipes are optional, so Name | Age on its own line works. If a row has fewer cells than the longest row it is padded with empty cells, and a row with more cells than the header keeps them, where GitHub would drop them. A note tells you how many rows were affected.
If no separator line is found at all, each block of lines with pipes is read as a table and a note says so. That covers tables copied from a chat or a terminal that left out the dashes.
What happens to bold, links and HTML in cells
- Bold, italics and strikethrough marks are removed, so
**Pen**becomes Pen. Underscores inside words, as in my_var_name, and a lone * as in 5 * 3 are left alone. - Code spans lose their backticks, and what is inside them is not changed any further.
- Links become their text by default. Their address gives only the URL, and Text (address) gives both, such as Docs (https://example.com). Images become their alt text.
- Simple HTML tags such as b, i, span, a and code are removed. A br tag becomes a space or a line break, as you choose.
- Backslash escapes are undone, so \* becomes *.
- Entities such as & and < are decoded.
Turn off Remove bold, italics, code and links to keep the Markdown text exactly as it is. Escaped pipes are still turned back into pipes, because they only exist to protect the table.
Open the CSV in Excel without broken characters
Excel may read a plain CSV file in the system code page, so accents, quotes and symbols can turn into odd characters. A UTF-8 byte order mark at the start of the file tells Excel to read it as UTF-8. Switch on UTF-8 BOM for Excel and Download adds it. Copy never adds it, because the mark is invisible and would sit in front of your first header.
In some countries Excel expects a semicolon between values, because the comma is the decimal mark. Choose Semicolon for those. Tab gives TSV, which pastes straight into a spreadsheet. Under More options you can quote every field and choose CRLF line endings for older Windows programs.
Quoting rules in the CSV
The output follows the usual CSV rules. A value is wrapped in double quotes when it contains the separator, a double quote, a line break, or spaces at its start or end. Quotes inside a value are doubled. For the cell Ada, "the first" programmer the line looks like this:
"Ada, ""the first"" programmer",1815Everything else is written as it is. Skip the header row by switching off Include the header row, for example when you add rows to a file you already have.
Limits and privacy
The tool reads pipe tables of the kind GitHub uses. It does not read grid tables, tables drawn with plus signs, or HTML tables, and it lists at most 500 tables from one document. The conversion runs in your browser, so the Markdown is not sent to a server and is not stored. See the Privacy Policy for details.
Related tools
To go back, CSV to Markdown Table builds an aligned table from CSV. If your table is on a web page, HTML Table to CSV extracts it and HTML Table to Markdown writes it in Markdown. Markdown to Text strips formatting from a whole document, CSV to HTML Table turns the result into a web table, and Merge CSV Files joins several CSV files into one.