FIRST CH TOOLS / 28 Markdown Table

Markdown Table Generator & CSV/TSV Converter

Paste a range copied from Excel or Google Sheets on the left and a Markdown table appears on the right. The delimiter (tab, comma or semicolon) is detected for you, and full-width characters are counted as two columns so the pipes line up. Paste a Markdown table instead and export it as CSV, TSV, HTML or JSON.

Paste and it converts as you type

Paste (TSV / CSV / Markdown)
Output
0
Rows
0
Columns
0
Cells
0
Output characters
Preview
What was read

    Nothing you paste leaves the browser — the parsing and the formatting both run on this page. Loading a file only reads it locally; it is never uploaded. You can call the tool straight from a URL: /en/markdown-table/?tsv=a%09b%0A1%092 or /en/markdown-table/?csv=a,b%0A1,2&to=html

    How to Use

    1. Paste your tableCopy a range in Excel or Google Sheets and paste it on the left. You can also drop a CSV file, or paste an existing Markdown table.
    2. Choose how it is formattedDecide whether the first row is a header, whether the cells are padded and whether full-width characters count as two. Alignment can be set per column.
    3. Copy the resultThe Markdown table appears on the right. Switch the output format to get the same data as CSV, TSV, HTML or JSON.

    About This Tool

    Markdown tables are not in the CommonMark spec. They are a GitHub Flavored Markdown (GFM) extension supported by GitHub, GitLab, Slack, Notion, Obsidian and most static site generators. The spec only defines a header row, a separator row and body rows, and a cell may only contain inline content on a single line — no paragraphs, lists or code blocks.

    Copying from a spreadsheet gives you tab-separated text. Select a range in Excel, Sheets or Numbers and the clipboard holds TSV, not CSV, so reading it as comma-separated collapses everything into one column. This tool parses the text with each candidate delimiter and keeps the one that gives the most consistent column count, which is why numbers with thousands separators (1,200) do not shift the columns. If the guess is wrong, state the format explicitly.

    Full-width characters are counted as two columns. Padding does not change the rendered table, but it changes how readable the source is in an editor and in a diff. Counting characters alone never lines up CJK text, because those glyphs occupy two cells in a monospaced font. This tool counts anything with an East Asian Width of Wide or Fullwidth as two, so the pipes stay straight in VS Code, Vim and the terminal. In an editor with a proportional font nothing will line up, whatever you do.

    Columns of numbers are right-aligned automatically. Money, counts and percentages are easier to compare when the digits line up on the right. A column qualifies when every non-empty cell looks like a number — thousands separators, decimals, a currency symbol, a percent sign or a unit are all allowed — and a single non-numeric cell disqualifies it. Use the per-column selects to override.

    Anything that would break the table is fixed for you. Pipes inside cells become \|, line breaks become <br> (or a space), and rows that are short get empty cells. None of this happens silently: every fix is counted and listed under “What was read”.

    It works in reverse too. Paste a Markdown table and the alignment colons are read back, then the data can be written out as CSV, TSV, an HTML <table> or JSON (an array of objects keyed by the headings). <br> becomes a real newline again, so a CSV export opens in a spreadsheet with the multi-line cells intact — handy when a table that lives in your docs needs to go back into a spreadsheet.

    Everything is read and written as UTF-8 (a leading BOM is removed). Convert Shift_JIS files first with the encoding & line ending converter. To show special characters as text inside a table, use the HTML entity escaper; to turn a whole document into a PDF, see Markdown → PDF.

    From AI Agents

    The same conversion is available as the markdown_table tool of the MCP (Model Context Protocol) server @first-ch/tools-mcp, so an AI agent can call it directly without a browser, including reading and writing files by path. See Using these tools from AI agents for setup details.

    Setup

    claude mcp add firstch-tools -- npx -y @first-ch/tools-mcp

    Examples

    # TSV to a Markdown table (delimiter detected, cells padded)
    markdown_table(text="Item\tPrice\nNotebook\t1200")
    
    # Read a CSV file and write the table to a file
    markdown_table(path="/tmp/sales.csv", outputPath="/tmp/sales.md")
    
    # Turn a Markdown table back into CSV
    markdown_table(text="| a | b |\n| --- | --- |\n| 1 | 2 |", to="csv")
    
    # Headerless data, named col1… and right-aligned
    markdown_table(text="1,2\n3,4", header="auto", align="right")

    Other Tools