Skip to main content

Markdown Table Formatter

Clean up and reformat a Markdown table: align columns, pad cells evenly, control the separator style and outer pipes, sort by any column, and export the same data as CSV, HTML or JSON.

Input

Formatting options

Auto reads the alignment markers (:---, :---:, ---:) from the separator row.

Sorts data rows (the header stays first). Numeric columns sort numerically. Columns beyond the table's width are ignored.

Output

Formatted table
 

Your formatted table will appear here.

Validation report

Export

CSV
 
HTML
 
JSON
 
Was this helpful?

Guides

Markdown tables are easy to write badly. Add a column, edit a cell, and the pipes drift out of alignment until the raw source is unreadable — even though it still renders fine. The Markdown Table Formatter takes any Markdown table you paste in and rewrites it with tidy, evenly-padded columns, so the source is as readable as the rendered result. It also hands you the same data back as CSV, HTML or JSON when you need to move it somewhere else.

Everything runs in your browser. Your table is never uploaded — the parsing, alignment and export all happen locally on this page.

How to use it

  1. Paste a Markdown table into the input box. A table is any block of |-separated rows, with an optional | --- | --- | separator row under the header.
  2. The formatted table, a live preview and the export views update as you type.
  3. Copy the formatted Markdown, or grab the CSV / HTML / JSON export.

Formatting options

  • Column alignmentAuto-detect reads the alignment markers in the separator row (:--- left, :---: center, ---: right) and keeps them. Or force every column left, center or right.
  • PaddingSpaced writes | value | with a space inside each pipe; Compact writes |value| with none.
  • Separator styleFull width stretches the separator dashes to match each column's width (so the divider lines up with the content); Minimal collapses every separator to a plain ---.
  • Sort by column — reorder the data rows by any column, keeping the header in place. Numeric columns (ages, prices, counts) sort numerically; everything else sorts alphabetically. Columns beyond the table's width are ignored.
  • Trim cell content — strip stray leading and trailing spaces from every cell before measuring column widths.
  • Include outer pipes — keep or drop the leading and trailing | on each row.

Export views

Alongside the reformatted Markdown you get three ready-to-use exports, built from the table's rows in their original order:

  • CSV — comma-separated, with values quoted only when they contain a comma, quote or newline. Drops straight into a spreadsheet.
  • HTML — a self-contained <table> with inline borders and padding, so it renders correctly wherever you paste it. Every cell is HTML-escaped, so < and & in your data stay literal text.
  • JSON — an array of objects, one per data row, keyed by the header cells.

Validation report

The report summarises the table's shape (column count and number of data rows) and flags the common problems that make a Markdown table render wrong: an inconsistent number of columns across rows, a missing separator row, or empty cells. These are warnings, not errors — the tool still reformats the table so you can see and fix the issue.

What counts as a valid Markdown table?

At minimum, one or more rows whose cells are separated by | pipes. A separator row (| --- | --- |) under the header is what tells Markdown renderers where the header ends; if you leave it out, this tool adds one for you after the first row.

Does it handle CJK and emoji widths?

Yes. Wide characters (Chinese, Japanese, Korean, and most emoji) count as two columns when measuring width, so columns still line up in a fixed-width editor.

markdowntableformattercsvjson

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.