MDUtil

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

  1. Paste or open data

    Paste CSV or TSV text, or open a .csv, .tsv or .xlsx file; for a workbook, pick the sheet.

  2. Check the settings

    The delimiter is detected; choose it yourself if needed, and say whether the first row holds the column names.

  3. Copy the table

    Copy the Markdown table or download it as a .md file.

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
.xlsx files are read directly, sheet by sheet, with dates written as 2024-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.