Markdown Table Formatter
Format markdown tables online. Align columns, prettify pipes, sort rows, transpose and add or remove columns from any markdown table. Free tool.
| Language | First release | Typing | Popularity | | ---------- | ------------- | ------- | ---------- | | Python | 1991 | dynamic | 1 | | Rust | 2015 | static | 7 | | TypeScript | 2012 | static | 4 | | Go | 2009 | static | 10 |
What Is a Markdown Table Formatter?
A markdown table formatter rewrites a pipe table so that every column has the same width, every row has the same number of cells and the separator line matches the declared alignment. The result renders the same as before, but the raw markdown is readable in an editor and produces small, reviewable diffs.
This page is also a lightweight markdown table editor: sort rows by a column, transpose the table, add or delete columns, change alignment and trim stray spaces, all with one click and without rebuilding the table by hand. Everything runs in the browser.
How to Format a Markdown Table
- Paste the table into the input pane. Ragged tables, missing outer pipes and uneven dashes are all accepted.
- Read the formatted version in the output pane. Choose Compact if you prefer single-space padding.
- Pick a column in the Column menu, then use Sort A→Z, Sort Z→A, Apply alignment, Add column after or Remove column.
- Click Transpose to swap rows and columns, or Trim cells to remove leading and trailing spaces.
- Operations rewrite the input, so you can chain them. Copy or download the result when it looks right.
Operations Reference
| Operation | What it does |
|---|---|
| Aligned pipes | Pads each cell to the widest entry in its column; right-aligned columns pad on the left |
| Compact | One space around each cell, minimal separator |
| Sort A→Z / Z→A | Markdown table sorter for the selected column; numbers sort by value, text by natural order |
| Apply alignment | Sets :---, :---: or ---: for the selected column |
| Add column after | Inserts an empty column to the right of the selected one |
| Remove column | Deletes the selected column from every row |
| Transpose | Rows become columns; alignment is reset |
| Trim cells | Strips leading and trailing whitespace in every cell |
| Format in place | Replaces the input with the formatted output |
Markdown Table Alignment Rules
Markdown table alignment lives entirely in the separator line. A colon on the left (:---) aligns the column left, colons on both sides (:---:) center it, and a colon on the right (---:) aligns right. With no colons the renderer uses its default, which is left for text on GitHub. The number of dashes has no effect on rendering, but the formatter stretches them to the column width so the separator lines up with the cells. Numeric columns read best right-aligned because the decimal points stack.
Why Formatting Matters
Unformatted tables are correct but hard to maintain: adding a value that is longer than its neighbours pushes every pipe out of line, and a reviewer cannot tell which cell changed. Running a markdown table formatter before you commit keeps the columns aligned so diffs show only the edited row. It also catches the classic mistake of a row with one cell too few, which renders as a broken table on GitHub. For tables that change often, sort them by a stable key column so contributors always add rows in the same place.
Frequently Asked Questions
Does formatting change how the table renders?
No. A markdown table formatter only changes whitespace and the separator line in the source; renderers ignore both. The rendered table on GitHub is identical before and after, but the raw file becomes readable and diffs stay clean.
How does sorting treat numbers?
Sorting is numeric-aware. When both cells in a comparison are numbers (including 1,000, $12 or 45%), they are compared by value; otherwise they are compared as text with natural ordering, so item2 comes before item10. Sorting is stable, so ties keep their original order.
What does transpose do?
Transpose table swaps rows and columns. The header becomes the first column and the first column becomes the header, which is handy when a table has many columns and few rows and would otherwise scroll horizontally.
Can I edit the table cells here?
Yes, edit the markdown in the input pane directly; the formatted result updates as you type. For a grid with per-cell inputs, send the table to the markdown table generator, which uses the same engine.
Why does the tool say no table was found?
It needs a header line, a separator line made of dashes such as |---|---|, and rows separated by newlines. Check that the separator is on the second line and that every row contains at least one pipe.