CSV to Markdown Table Converter
Paste CSV or open a .csv, .tsv or Excel .xlsx file and get a clean Markdown table. The file is read in your browser and never uploaded.
CSV or TSV
169 characters5 lines
| Country | Capital | Population (millions) | Area (km²) |
| ------- | -------- | --------------------: | ---------: |
| Japan | Tokyo | 124.5 | 377,975 |
| Germany | Berlin | 84.5 | 357,592 |
| Brazil | Brasília | 203.1 | 8,515,767 |
| Kenya | Nairobi | 55.1 | 580,367 |How to convert CSV to a Markdown table
Paste or open data
Paste CSV or TSV text, or open a
.csv,.tsvor.xlsxfile; for a workbook, pick the sheet.Check the settings
The delimiter is detected; choose it yourself if needed, and say whether the first row holds the column names.
Copy the table
Copy the Markdown table or download it as a
.mdfile.
What it handles
- Delimiter detected
- Commas, semicolons, tabs and pipes are recognised, including the semicolons Excel uses in many European languages.
- Quoted fields
- Values in quotes keep their commas, line breaks and doubled quotes, as the CSV standard defines.
- Excel workbooks
.xlsxfiles are read directly, sheet by sheet, with dates written as2024-05-17.- Numbers aligned right
- Columns that hold only numbers, prices or percentages are right-aligned, the way spreadsheets show them.
- Readable source
- Cells are padded so the pipes line up, with Chinese and Japanese characters counted as double width.
- Tables that hold together
- Pipes in values are escaped and line breaks become
<br>.
Convert CSV to Markdown in code
Python
pandas writes a Markdown table with to_markdown, which needs the tabulate package.
import pandas as pd
print(pd.read_csv("data.csv").to_markdown(index=False))
Pandoc
Pandoc reads CSV files and writes them as GitHub Flavored Markdown tables.
pandoc data.csv -f csv -t gfm -o data.md
Questions and answers
How do I convert CSV to a Markdown table?
Paste the CSV above or open the file, then copy the Markdown table on the right. The conversion runs in your browser.
How do I convert an Excel file to Markdown?
Open the
.xlsx file here and choose the sheet. For a few cells, copy them in Excel and paste them into the Markdown Table Generator.My CSV uses semicolons. Does it work?
Yes. The delimiter is detected, and you can also choose comma, semicolon, tab or pipe yourself. Excel saves CSV with semicolons in languages that write decimals with a comma.
What if the data has no header row?
Switch off First row is the header; the columns are then named Column 1, Column 2 and so on, and you can rename them in the Markdown.
How large a file can I convert?
Files up to 20 MB. Tables with thousands of rows convert, but they are hard to read as Markdown, so consider splitting them.
Is my file uploaded anywhere?
No. The file is read in your browser, so the data never leaves your device.
Related tools
- Markdown Table GeneratorBuild tables in a grid, paste from Excel and copy Markdown.
- HTML Table to MarkdownPaste a table from a web page or spreadsheet and get Markdown.
- Markdown to WordDownload an editable .docx with Word headings, tables and equations.
- Markdown to PDFSave a PDF with selectable text, formulas, highlighted code and page numbers.
- ChatGPT to WordTurn a copied ChatGPT answer into a .docx with editable equations.
- ChatGPT to PDFSave a ChatGPT answer as a PDF with typeset formulas and tables.