How to Convert CSV and TSV to Markdown Tables
From raw delimited text to a valid Markdown table — delimiter checks, quoting rules, and verification.
Start with the raw text, not a screenshot
Conversion needs the actual delimited text — open the .csv file in a text editor (or copy the cells at the source) rather than working from a rendered preview. What looks like one column on screen may contain commas, quotes, or line breaks that only the raw text reveals.
Check the delimiter before converting
The converter auto-detects the separator, but knowing yours helps you spot mis-split columns:
- Comma — standard CSV exports.
- Tab — TSV, including anything pasted from Excel or Google Sheets.
- Semicolon — European-locale exports.
- Pipe — logs and pipe-delimited dumps.
If every value lands in a single column, the wrong delimiter was guessed — check for a mix of separators in the source.
Respect quoted fields
A field like "Product, Large" is one value, not two columns — quotes protect embedded commas, quotes (""), and even line breaks per RFC-4180. Never strip quotes with find-and-replace before converting; the parser needs them to group fields correctly.
Paste, verify, copy
Paste the text or upload the file in the CSV to Markdown converter, then verify: uniform column counts, escaped pipes (\|), and multiline values joined with<br>. A typical clean result looks like this:
| Name | Note |
|:--------------|:---------------------|
| Widget, Large | Ships<br>in 24h |If the table still misbehaves, work throughwhy Markdown tables break and how to fix them, or check theMarkdown table syntax reference for the exact output rules.
Character Encoding & Mojibake Prevention
A common source of corrupted characters (such as é instead of é or â€" instead of —) is mismatched text encodings during CSV export:
- UTF-8 Standard: Modern software defaults to UTF-8 without Byte Order Marks. Our converter enforces UTF-8 parsing, accurately preserving European accented characters, Asian CJK ideographs, and typographical symbols.
- Legacy Windows-1252 / ANSI: Older database export utilities often emit files encoded in Windows-1252 (CP1252). If you see garbled characters, open the file in VS Code or Notepad++, select Reopen with Encoding → Windows-1252, and save as standard UTF-8 before converting.
CLI Pipeline: Formatting CSV to Markdown in Bash
For Linux and macOS developers working in the terminal, Unix utility pipelines provide rapid tabular formatting:
cat data.csv | sed 's/"//g' | awk -F',' '{
if (NR==1) {
print "| " $0 " |";
for (i=1; i<=NF; i++) sep = sep "--- | ";
print "| " sep;
} else {
print "| " $0 " |";
}
}' | sed 's/,/ | /g'
While shell scripts work for simple flat CSVs, they fail on multiline fields and embedded quotes. Our client-side Web engine handles all RFC-4180 edge cases with full structural tokenization.
Tab-Separated Values (TSV) & Database Query Dumps
TSV files are widely used in bioinformatics, machine learning dataset splits, and relational database exports (PostgreSQL \copy, MySQL SELECT ... INTO OUTFILE). Tab characters never collide with commas inside numeric or geographical fields, making TSV the most robust tabular transfer format.
ExcelToMarkdown automatically detects tab characters and converts database dumps directly into clean documentation tables in under 100 milliseconds.
Related guides
Frequently asked questions
Does this handle TSV as well as CSV?
Yes. Tab-separated values are auto-detected, so pastes from Excel or Google Sheets and .tsv content convert here — no separate TSV tool is needed.
What about semicolon-delimited exports?
Semicolon delimiters are auto-detected too. They are common in European-locale CSV exports where the comma is a decimal separator.
Which file encoding should my CSV use?
UTF-8 works best. If accented characters appear garbled after upload, re-save the file as UTF-8 (Excel: Save As → CSV UTF-8) and convert again.