EthicalFusion

CSV to Markdown Table

Convert CSV into a GitHub-flavored Markdown table for README files and docs.

Was this tool helpful?

Thanks for the feedback!

Paste CSV data and this converter outputs a GitHub-flavored Markdown table, with the first CSV line as the header row and the required separator row added underneath. It is built for developers and technical writers who keep data in a spreadsheet but need it in a README, pull request, wiki page or docs site.

An example with the tricky parts

Input:

Name,Plan,Price
Asef,Pro | Yearly,999
Riya,Basic
Kiran,Team,4999,extra

Output after clicking Generate Markdown:

| Name | Plan | Price |
| --- | --- | --- |
| Asef | Pro \| Yearly | 999 |
| Riya | Basic |  |
| Kiran | Team | 4999 |

Three rules are visible here. The pipe inside "Pro | Yearly" is escaped as \| so it does not start a new column. Riya's short row is padded with an empty cell so every row matches the header. Kiran's extra fourth value is dropped, because the header defines three columns.

How the Markdown table is structured

A GitHub-flavored Markdown (GFM) table needs a header row followed by a delimiter row of dashes, one per column. The converter writes --- for every column, which means default alignment. To change alignment, edit the delimiter row after copying:

  • :--- aligns the column left.
  • :---: centres it.
  • ---: aligns it right, which suits prices and other numbers.

The outer pipes and single spaces around each cell are optional in GFM but make the raw text easier to read in a code review. Columns do not need to line up in the source for the table to render correctly.

How the CSV is read

  • Values are split on commas; wrap a value in double quotes if it contains a comma, such as "Pune, MH".
  • A doubled quote inside a quoted value becomes one quote mark.
  • Blank lines are skipped, and both Windows and Unix line endings work.
  • Semicolon- or tab-separated data is not split. Convert it to commas first.

Where it renders, and where it does not

GFM tables display on GitHub, GitLab and Bitbucket, and in many documentation generators and note apps. Some Markdown tools, especially older ones built only on the original Markdown syntax, show them as plain text. Preview your table in the Markdown to HTML converter if you are unsure.

Limits to watch for

  • Line breaks inside a cell break the row, because a Markdown table row must stay on one line. Replace them with a space, or with <br> where your platform allows inline HTML, as GitHub does.
  • Markdown characters such as asterisks or backticks in your data are passed through, so *sale* will appear in italics.
  • Very wide tables are hard to read on small screens; consider splitting columns across two tables.

To go back from Markdown to CSV, use Markdown Table to CSV; for a web page, CSV to HTML Table writes HTML markup instead.

Frequently asked questions

How do I make a Markdown table from CSV?
Paste the CSV with column names on the first line and click Generate Markdown. The header, separator row and data rows are written for you.
What happens to pipe characters in my data?
Each pipe is escaped with a backslash so it shows as text instead of splitting the cell.
How do I right-align a column of numbers?
In the second line of the output, change that column's dashes to ---: with a colon on the right.
Why does my table have an empty cell at the end of some rows?
Rows shorter than the header are padded with empty cells so every row has the same number of columns.
Can a Markdown table cell contain a line break?
Not as a real line break. Replace it with a space, or with an HTML br tag on platforms such as GitHub that accept inline HTML.

Related tools

Embed this tool on your site

Paste it into any blog or website. Free, with a credit link.