Turn a Markdown Table into a Clean CSV in Seconds
Paste your Markdown table above and get a properly formatted CSV file back instantly — no signup, no upload, nothing leaves your browser. It works whether you copied the table from a README, a wiki, or a docs site.
Markdown input:
| Name | Score | Grade |
|---------|-------|-------|
| Alice | 95 | A |
| Bob | 82 | B |
CSV output:Name,Score,Grade
Alice,95,A
Bob,82,B
Paste your Markdown table into the converter above, then copy or download the result. Quoted fields and numeric values are handled automatically. Everything runs in your browser — nothing is uploaded.
How to Convert Markdown to CSV
- Copy your Markdown table — from a README, GitHub, Notion, or anywhere else.
- Paste it into the input box above and select Markdown as the source format.
- Choose CSV as the output format.
- Hit Convert — the CSV appears instantly in the output panel.
- Copy to clipboard or click Download to save the
.csvfile.
Worked Example: Markdown Table to CSV
Say you have this product table in a Markdown file:
| Product | Price | In Stock |
|-------------|--------|----------|
| Widget A | 12.99 | Yes |
| Gadget B | 249.00 | No |
| Doohickey C | 3.50 | Yes |
After conversion, you get a clean CSV ready to open in Excel, Google Sheets, or any data tool:
Product,Price,In Stock
Widget A,12.99,Yes
Gadget B,249.00,No
Doohickey C,3.50,Yes
Notice that numeric values like 12.99 stay as numbers, not wrapped in quotes. If a cell contains a comma, the converter automatically wraps it in double quotes so the CSV stays valid.
How to Do This in Python
If you need to automate markdown table to CSV conversion in a script, here are two clean options:
Python — using the pandas library:
# Python 3 — requires: pip install pandas
import pandas as pd
import io
markdown = """
| Name | Score |
|-------|-------|
| Alice | 95 |
| Bob | 82 |
"""
# Strip pipe edges and split rows
lines = [l.strip() for l in markdown.strip().split('\n') if not set(l.strip()) <= set('|-: ')]
rows = [[cell.strip() for cell in line.strip('|').split('|')] for line in lines]
df = pd.DataFrame(rows[1:], columns=rows[0])
df.to_csv('output.csv', index=False)
print(df)
JavaScript — useful in Node.js or a browser script:
// Node.js or browser — no dependencies needed
function markdownTableToCsv(md) {
const lines = md.trim().split('\n').filter(
line => !line.replace(/[|\-: ]/g, '').length === 0 && !/^[|\s\-:]+$/.test(line)
);
return lines.map(line =>
line.trim().replace(/^\|/, '').replace(/\|$/, '')
.split('|')
.map(cell => {
const v = cell.trim();
return v.includes(',') ? `"${v}"` : v;
})
.join(',')
).join('\n');
}
const md = `| Name | Score |\n|-------|-------|\n| Alice | 95 |\n| Bob | 82 |`;
console.log(markdownTableToCsv(md));
// Name,Score
// Alice,95
// Bob,82
For one-off conversions, the tool above is faster. Use the code route when you need to process dozens of files or embed conversion in a pipeline.
How It Works
Markdown tables follow a simple pipe-delimited syntax defined by the CommonMark spec and the GitHub Flavored Markdown (GFM) tables extension. The converter strips the pipe characters (|) and the separator row (the dashes line), then maps each remaining row to a comma-separated line.
If any cell value contains a comma, a double-quote, or a newline, it gets wrapped in double quotes — that follows the RFC 4180 CSV standard so the output is universally compatible. Numbers are kept unquoted; text with special characters is escaped correctly.
All processing runs client-side in your browser. Your table data is never sent to a server, so confidential or work data stays private.
When to Use This Tool (and When to Use Something Else)
| Situation | Best move |
|---|---|
| Copying a table from a README or wiki into a spreadsheet | Use this tool |
| Sharing tabular data with a non-technical colleague | Use this tool — CSV opens in Excel and Google Sheets |
| Batch-converting 50+ Markdown files | Use the Python script above or a CLI tool |
| Table has merged/nested cells | GFM tables don't support merging — clean the source first |
| You need JSON instead of CSV | Switch the output format to JSON in the converter above, then use our JSON Beautifier to format it nicely |
Related Tools You Might Need
- After exporting JSON data, clean it up with the JSON Beautifier — Format, Validate & Minify JSON Online.
- Check your converted output is valid with the JSON Validator — Check & Fix JSON Errors Online.
- Need a compact version of a JSON export? Try the JSON Minifier — Compress & Minify JSON Online.
Takeaway: If you have a Markdown table and need a spreadsheet-ready CSV, paste it into the converter above and download your file in a few seconds — no account required.