How to convert CSV to Markdown
Updated · 3 min read
Writing Markdown tables by hand is tedious: aligning pipes, counting dashes and escaping special characters. Paste CSV — or cells copied straight from Excel or Google Sheets — and get a neatly padded Markdown table that reads well both rendered and in plain text.
- Paste CSV, or copy cells from Excel / Google Sheets and paste them (tab-separated data is detected).
- The Markdown table appears with padded columns; numeric columns are right-aligned.
- Copy the table into your README, documentation, wiki or issue.
- Need the reverse? Choose Markdown as the source to turn a table back into CSV or JSON.
Example
CSV input
Plan,Price (USD),Users,Notes
Free,0,1,Community support
Pro,12,5,"Priority support | SLA"
Team,49,25,Includes SSOMarkdown output
| Plan | Price (USD) | Users | Notes |
| ---- | ----------: | ----: | ----------------------- |
| Free | 0 | 1 | Community support |
| Pro | 12 | 5 | Priority support \| SLA |
| Team | 49 | 25 | Includes SSO |The numeric columns are right-aligned with --:, and the pipe character inside the Notes column is escaped as \| so it does not break the table.
Your data stays on your device. The conversion runs in JavaScript inside this tab — files and pasted text are never uploaded to DataSwitch Pro.
GitHub Flavored Markdown tables
A Markdown table is a header row, a separator row of dashes and one line per row, with cells separated by pipes. Colons in the separator set alignment: :-- left, :-: centre and --: right. This GFM syntax is supported by GitHub, GitLab, Bitbucket, Azure DevOps, Obsidian, Docusaurus, MkDocs, VS Code previews and most static site generators.
What the converter takes care of
- Escaping: pipe characters in values become
\|. - Line breaks inside cells become
<br>, which GitHub renders as a new line. - Alignment: columns that contain only numbers are right-aligned.
- Readable source: columns are padded to equal width, and wide characters such as Chinese or Japanese are counted as double width.
From Excel or Google Sheets
You do not need to export a CSV: select the cells in your spreadsheet, copy, and paste into the input box — spreadsheets copy cells as tab-separated text, which is detected automatically. For a whole workbook, choose Excel as the source format and upload the file.
Convert CSV to Markdown in code
For one-off files the tool above is quickest. To automate the same task in a script or pipeline, these snippets are a good starting point.
Python (pandas)
import pandas as pd # pip install pandas tabulate
df = pd.read_csv("plans.csv")
print(df.to_markdown(index=False))
Frequently asked questions
Can I convert JSON to a Markdown table?
Yes. Choose JSON as the source — each object becomes a row and nested objects are flattened into columns.
Does it work with Notion or Confluence?
Notion and many editors convert pasted Markdown tables into native tables. Confluence prefers HTML — use the CSV to HTML converter for it.
How do I centre a column?
Change that column's separator from dashes to :---: in the output.
Can I convert a Markdown table back to CSV?
Yes. Select Markdown Table as the source and CSV as the target.
Is my data uploaded?
No. The table is generated in your browser.