Markdown Toolbox Logo Markdown Toolbox
Home
Blog

How to manually convert CSV to a Markdown table

2024-07-23

Short version

  1. Open your CSV file in a text editor.
  2. Replace commas with pipe characters |.
  3. Add headers and separators.

Long version

1. Open the CSV File

Use a text editor (e.g., Notepad, VSCode) to open your CSV file. The data should be separated by commas.

2. Replace Commas with Pipes

Manually replace each comma , with a pipe |. This is the character Markdown uses to separate columns.

Example CSV:

Name,Age,Location
John,30,USA
Jane,25,Canada

Converted:

| Name | Age | Location |
|------|-----|----------|
| John | 30  | USA      |
| Jane | 25  | Canada   |

3. Add Headers and Separators

Once you have replaced the commas, make sure to include a header row with a separator row beneath it using dashes -. Each pipe in the header and separator is mandatory to maintain the table structure.

4. Final Markdown Table

Your final Markdown table should look like this:

| Name | Age | Location |
|------|-----|----------|
| John | 30  | USA      |
| Jane | 25  | Canada   |

With this format, you can now display your data as a table in Markdown.