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
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
Where Markdown tables break
The header row and the separator row are mandatory
| Item | Price | | --- | --- | ← without this line it is not a table | Notebook | 1200 |
Markdown tables are not part of the CommonMark spec; they come from GitHub Flavored Markdown (GFM), which GitHub, GitLab, Slack, Notion, Obsidian and most static site generators support. GFM needs a header row followed by a row of hyphens, and without either one the block is rendered as an ordinary paragraph. If you do not want headings, set “First row” to Data (blank header) and you get a table whose header cells are empty.
The header row decides how many columns there are
| A | B | | --- | --- | | 1 | 2 | 3 | ← the third cell is dropped | 4 | ← missing cells are filled in as empty
GFM takes the number of cells in the header row as the column count and discards anything past it, padding short rows with empty cells. When pasted data has ragged rows this looks like “some of my data disappeared”, so this tool pads every row out to the widest one and tells you how many rows it had to fix.
A | inside a cell has to be escaped
| Case | Expression | | --- | --- | | or | a \| b | ← write \|
The pipe separates cells, so a literal pipe has to be written as \|. That is true inside code spans too (`a | b`), which is the case people usually get wrong, because the table is parsed before inline code. This tool escapes pipes in your data automatically.
A cell cannot contain a line break
| Item | Notes | | --- | --- | | Shipping | Free over $30<br>Islands cost extra |
Every table row has to fit on one line, so a raw newline inside a cell is not allowed — use <br> instead. A line break made with Alt+Enter in Excel arrives inside a quoted field, and this tool rewrites it as <br> (or a space). Going the other way, <br> is turned back into a real newline, so exporting to CSV restores the multi-line cell.
Alignment comes from the colons in the separator row
| Left | Center | Right | | :--- | :---: | ---: | | a | b | 1,200 |
A colon on the left aligns left, one on each side centres, one on the right aligns right. Columns without a colon fall back to whatever the renderer does by default (usually left). Money and counts are easier to read right-aligned, so this tool right-aligns any column that holds only numbers — and you can override each column yourself.
Padding the cells changes nothing about the output
| Item | Price | | ------------ | ----: | | Notebook | 1,200 | | Fountain pen | 8,800 |
Lining the pipes up renders exactly the same as a compact table. It matters when you read the source in an editor or review a diff. Full-width characters take two columns in a monospaced font, so counting characters alone never lines up a Japanese table. This tool counts them as two, which makes the pipes straight in VS Code or Vim (an editor with a proportional font will still look ragged).
Copying from Excel gives you tabs, not commas
Item→Price→Qty ← the arrows are tab characters Notebook→1,200→3
When you copy a range in Excel, Google Sheets or Numbers, the clipboard holds tab-separated text. Reading that as CSV would give you a single column. This tool detects the delimiter, but you can pick it by hand under “Input format”. Data with thousands separators (1,200) is safest pasted as tab-separated, because reading it as CSV splits the number in two.
CSV quoting (RFC 4180)
Item,Notes "Notebook, A5","a cell with a line break" "a quote is written as """""
A cell containing a comma, a newline or a quote is wrapped in "…", and a quote inside it is doubled. This tool reads and writes that convention, and when exporting it only quotes the cells that need it — those holding the delimiter, a newline, a quote or leading/trailing spaces.
Watch the encoding of CSV files bound for Excel
UTF-8 (no BOM) → Excel may show mojibake UTF-8 (BOM) → opens correctly in Excel Shift_JIS → for older Japanese systems
This tool reads and writes UTF-8 (a leading BOM is stripped for you). A Shift_JIS CSV will come out as mojibake, so convert it first with the encoding & line ending converter.
Leave a blank line around the table
Some explanation. | A | B | | --- | --- | | 1 | 2 | The next paragraph.
If the line above is a paragraph, some renderers treat the table as a continuation of it and never build a table. Put a blank line before and after. Inside a list, indent every row of the table to the same depth as the list item content.
HTML inside a cell is rendered as HTML
| Tag | Meaning | | --- | --- | | <b> | turns the rest bold unless you escape it |
GFM passes HTML in a cell straight through, so <b> acts as a tag. To show it as text, escape it to <b> first with the HTML entity escaper. This tool flags cells that contain tags.
Input formats: TSV, CSV (RFC 4180 quoting), semicolon-separated and Markdown tables (with or without the outer |, with alignment colons, \| escapes and <br>). Output formats: Markdown table, CSV, TSV, semicolon-separated, an HTML <table> and JSON (an array of objects keyed by the headings).
How to Use
- 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.
- 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.
- 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
- 01Batch Image → WebPWebP Converter
- 02White Background RemoverWhite BG Remover
- 03WCAG Contrast CheckerContrast Checker
- 04Character CounterCharacter Counter
- 05llms.txt Generatorllms.txt Generator
- 06JSON-LD GeneratorJSON-LD Generator
- 07Markdown → PDFMD → PDF
- 08OGP Meta Tag WizardOGP Wizard
- 09Favicon GeneratorFavicon Generator
- 10TikTok PublisherTikTok Publisher
- 11Encoding & Line Ending ConverterEncoding Converter
- 12Batch Image → AVIF + pictureAVIF Converter
- 13Test Data GeneratorTest Data Generator
- 14Marp Markdown → SlidesMarp Slides
- 15Text & Code Diff CheckerDiff Checker
- 16Cron Explainer & Next RunsCron Explainer
- 17Base64 & Data URI EncoderBase64 & Data URI
- 18URL Parameter Editor & UTM BuilderURL Parameters
- 19HTML Entity Escape & UnescapeHTML Escape
- 20JSON ⇄ YAML ConverterJSON ⇄ YAML
- 21PX ⇄ REM / EM ConverterPX ⇄ REM / EM 単位変換
- 22Color Converter & AlphaColorコード変換&アルファ透過
- 23MD5 / SHA-256 Hash Generatorハッシュ生成
- 24JWT Decoder & Expiry CheckerJWTデコーダー&有効期限チェッカー
- 25User-Agent ParserUser-Agent解析&デバイス判定
- 26UUID & ULID GeneratorUUID (v4) & ULID 一括生成
- 27Aspect Ratio Calculatorアスペクト比計算&サイズ算出
- 29SQL Query FormatterSQLクエリフォーマッター&整形
- 30QR Code GeneratorQR Code Generator
- 31Regex Tester正規表現テスター
- 32Unix Timestamp ConverterUNIXタイムスタンプ⇄日時変換
- 33New Tab Memo — Chrome Extension新規タブメモ帳 Chrome拡張
- 34Image Resizer & Cropper画像リサイズ&クロップ
- 35EXIF Viewer & RemoverEXIF情報の確認&除去
- 36robots.txt Generatorrobots.txt ジェネレーター
- 37Password Generator安全なパスワード生成
- 38Case Converter文字列ケース変換