How to format Markdown tables
Format a Markdown table
- Paste a table into the input area, with a header row followed by a separator row.
- Choose Upload to read a selected text file into the input.
- Change Minimum column width or select Use compact separator row (---) instead of full-width dashes.
- Read the output. It updates when the input or an option changes. If the table has too few lines or an invalid second row, the error box appears.
- Use Copy or Download for the formatted table.
What Markdown table formatting changes
Each column is at least Minimum column width characters wide, then expands to fit its longest header or data cell. For example:
| Name | Age |
|---|---|
| Ana | 7 |
| Name | Age |
| ---- | --- |
| Ana | 7 |
Minimum column width is clamped to 3 through 40. Select Use compact separator row (---) instead of full-width dashes to make every separator cell three characters wide. The output can contain ---, :--, --:, or :-:, depending on the alignment marker.
How Markdown pipe tables are read
Leading and trailing blank lines are removed before parsing. The first two remaining lines become the header and separator. Every separator cell needs at least one hyphen, with an optional colon at either end, such as ---, :---, ---:, or :---:. The formatter does not validate the rest of the header or data-row syntax.
The output uses the largest cell count across all rows. A short row receives empty trailing cells, while a later row with extra cells expands the header and output. An escaped pipe, \|, stays in its original cell and is escaped again in the result. The formatter rebuilds raw table text; it does not check how another Markdown renderer displays it.
When to use this table formatter
Check the output before committing a Markdown README when uneven source spacing makes columns hard to scan. Paste the table, inspect the aligned source, then use Copy or Download to place it in a file. The output footer reports line and character counts, and Download names the file markdown-table.md.
For other jobs in Text Formatting & Layout Tools, choose Align Text Columns for delimiter-separated text with selectable delimiters and alignment modes. Use Text Aligner for left, center, right, or justified text, or Indent Text for adding and removing indentation.
Frequently asked questions
What if my Markdown table has no separator row?
The formatter shows an error and produces no result. It requires a header row followed by a valid second-row separator.
How does it align Markdown table columns?
It pads each column to its widest header or data cell. Separator markers set left, right, center, or default alignment.
Can a Markdown table row have fewer columns?
Yes. Missing trailing cells become empty, and any extra cells in another row increase the output column count.
Does the formatter send my table text anywhere?
The formatter parses and rebuilds the table in browser-side JavaScript. The page code has no request that sends the table text.