CSV to Markdown Table
Convert CSV, TSV or semicolon-separated data into a neat Markdown table with aligned columns. Handles quoted fields and commas inside values.
Convert CSV, TSV or semicolon-separated data into a neat Markdown table with aligned columns. Handles quoted fields and commas inside values.
Markdown tables are tedious to type and keep aligned. Paste CSV, or copy cells straight from a spreadsheet, and get a tidy table you can drop into a README, issue or document.
The parser understands quoted fields, commas and line breaks inside quotes, and escapes pipe characters for you.
| name | age | | ---- | --- | | Ada | 36 |
CSV looks simple but RFC 4180 defines subtle rules. Fields containing the delimiter, a double quote or a line break must be wrapped in double quotes, and a literal quote inside a quoted field is written as two quotes in a row. A naive split on commas breaks on these cases, which is why a real parser walks the text character by character and tracks whether it is inside quotes. Spreadsheet exports from Excel or Sheets usually follow this convention, so a field such as "Smith, Jane" stays a single cell instead of becoming two columns.
A Markdown table is built from a header row, a separator row of hyphens, and body rows separated by pipes. The colons in the separator row control alignment: a colon on the left means left aligned, on the right means right aligned, and on both sides means centered. Plain Markdown has no way to merge cells or to hold a line break inside a cell, so multi-line values should be flattened first. Column padding in the output is only cosmetic, since renderers ignore extra spaces, but it keeps the raw text readable in a repository.
Copy the cells and paste them here, then set the delimiter to Tab.
Wrap the value in double quotes in your CSV. The parser keeps it as one cell.
A | would split the cell in Markdown, so it is written as \|.
No. It is converted in your browser.
Standard Markdown tables cannot hold a real line break in a cell. Replace line breaks with a space or an HTML br tag if your renderer allows inline HTML, then convert.
Padding is added for readability in plain text only. If the rendered table looks off, the usual cause is rows with a different number of fields, or a delimiter that does not match your data.