Use CSV to Markdown Table

Enter your data below to use the CSV to Markdown Table

📌 Try these examples:
RESULT

Last updated

Why Convert CSV to Markdown?

Markdown tables are the standard way to display tabular data in README files, GitHub wikis, documentation sites (like Docusaurus, MkDocs, or GitBook), and pull request descriptions. CSV is the universal export format from spreadsheets, databases, and data tools. Converting between them is a daily task for developers writing technical documentation.

A Markdown table uses pipe characters (|) to separate columns and a separator row of dashes to distinguish the header from the data rows. Most Markdown renderers support optional column alignment using colons in the separator row.

Markdown Table Syntax

Markdown
| Name    | Age | City        |
| ------- | --- | ----------- |
| Alice   | 30  | New York    |
| Bob     | 25  | Los Angeles |
| Charlie | 35  | Chicago     |

<!-- Column alignment with colons: -->
| Left    | Center | Right  |
| :------ | :----: | -----: |
| text    | text   | text   |

CSV Edge Cases to Watch For

Simple CSV splitting on commas breaks when cell values contain commas or newlines. The RFC 4180 CSV standard specifies that such values must be wrapped in double quotes:

Converting in the Terminal

Python
import csv, sys

def csv_to_markdown(filepath):
    with open(filepath, newline='', encoding='utf-8') as f:
        reader = csv.reader(f)
        rows = list(reader)

    if not rows:
        return ''

    # Header row
    header = rows[0]
    lines = ['| ' + ' | '.join(header) + ' |']
    lines.append('| ' + ' | '.join(['---'] * len(header)) + ' |')

    # Data rows
    for row in rows[1:]:
        # Pad short rows, escape pipe chars
        cells = [c.replace('|', '\|') for c in row]
        while len(cells) < len(header):
            cells.append('')
        lines.append('| ' + ' | '.join(cells) + ' |')

    return '
'.join(lines)

print(csv_to_markdown(sys.argv[1]))

Markdown Table Limitations

Standard Markdown tables don't support merged cells, multi-line cells, or complex formatting. For those cases, use HTML tables directly — most Markdown renderers pass through raw HTML. GitHub Flavored Markdown (GFM) supports basic tables but not colspan or rowspan.

Frequently Asked Questions

Simply enter your data, click the process button, and get instant results. All processing happens in your browser for maximum privacy and security.