How to make a Markdown table from a CSV file
What a Markdown table is made of, how to align its columns, and what to do about pipes, line breaks and wide tables.
By OpenAnyDoc ·
The short answer
Open or paste the CSV in CSV to Markdown: the first row becomes the table header, a separator line follows, and every other row becomes one line between pipes. Copy the result into a GitHub README, an issue, your docs or a chat, or download it as an .md file. Pipes inside cells are escaped for you, so the columns stay in place.
What a Markdown table is made of
A Markdown table is plain text that GitHub, GitLab and most Markdown editors draw as a table. It has three parts:
- The header line: the column names between pipes, such as | Item | Qty | Price |.
- The separator line: three dashes per column, such as | --- | --- | --- |. Without it the lines are shown as ordinary text.
- One line per row, with the cells in the same order as the header.
Alignment
The converter writes plain --- separators, which most readers show left-aligned. To align a column, edit its part of the separator line after you paste: :--- for left, :---: for centre and ---: for right. Right-aligning number columns makes prices and totals easier to compare. Only the separator line changes; the cells stay as they are. GitHub and GitLab follow these colons; a few simple editors ignore them and show every column the same way.
Pipes, line breaks and other characters in cells
Because the pipe marks a column border, a | inside a cell would split it in two. The converter writes it as \|, which readers show as a plain pipe. A few other cases are worth knowing:
- A line break inside a cell is written as <br>. GitHub shows it as a new line within the cell; some editors show the tag as text, so shorten such cells if the table is going elsewhere.
- Markdown inside cells still works: *text* becomes italic and backticks become code. If a cell holds asterisks or underscores that should stay as they are, check the rendered table.
- Arabic letters stay as they are in a UTF-8 file or an Arabic Windows CSV, and accented letters stay as they are in a UTF-8 file or a Western European Windows CSV. The delimiter (comma, semicolon, tab or pipe) is detected from the file, so a semicolon CSV saved by Excel in Europe keeps its columns.
The header row decides the columns
A Markdown table needs a header, so the first row of the CSV always becomes it. If your file has no header row, add one in the CSV viewer before converting, even if it is only Column 1, Column 2.
The header also sets the number of columns. A row with fewer cells gets empty ones at the end; a row with more cells than the header loses the extra ones. Give every column a name and nothing is dropped.
Wide and long tables
Markdown has no limit on columns, but a reader does. On GitHub a wide table scrolls sideways, and on a phone more than five or six columns get hard to follow. If the table is for people to read:
- Remove the columns readers do not need before converting.
- If you have few rows and many columns, flip them with Transpose so each field becomes a row.
- Keep the full data as a CSV file in the repository and show a short table that links to it.
What a Markdown table cannot hold
These limits come from Markdown itself, not from the converter, so no tool can get around them:
- No merged cells and no cells that span rows: complex layouts flatten into simple rows.
- No colours, fonts or cell borders; style comes from wherever the table is shown.
- No formulas: the table holds text. Totals must be in the CSV already.
- No second header row; if your CSV has two, merge them into one line of names first.
Long tables in the converter
The preview shows the first 5,000 lines of the table. Copy and Download always take the whole table, so nothing is cut from what you paste. The file is read by your browser and never uploaded, which matters when the CSV is an export from a work system.
Pasting the table into a chat
A Markdown table is easy for an AI chat to read, because each value sits under its column name. A table costs more tokens than the same data as CSV, so for large tables count first with the token counter. If the data comes from a workbook, Excel to Markdown does the same job sheet by sheet, and the guide on giving an AI chat a spreadsheet covers size, formulas and hiding personal data.
Step by step
From file to rendered table:
- Open CSV to Markdown and choose the .csv or .tsv file, or paste the CSV text into the box.
- Check the preview: the header, the separator, then one line per row.
- Click Copy, paste the table into your README, issue or note, and adjust the separator line if you want alignment.
- Preview the page (on GitHub, the Preview tab) before you commit or post.
Questions?
Write to support@openanydoc.com and paste the first two lines of the CSV and where the table goes wrong (no personal data).