Markdown Table Formatter

Align Markdown table columns in the source.

Input
MARKDOWN input
Output
Result

About this tool


A Markdown table renders correctly regardless of how ragged its source looks, but the source is far easier to edit when the pipes line up. This pads every cell so columns align in the raw text.

It is most useful after hand-editing a table, where changing a single value leaves the whole grid uneven and every subsequent diff noisier than the change deserves. Alignment markers in the separator row are preserved, and the padding follows them, so a centred column stays centred.

How to use it

  1. Paste or upload your markdownDrop a file onto the input pane, use the file picker, or paste the text directly.
  2. Adjust the options if neededThe defaults suit most input; open Options to change the behaviour.
  3. Format tablePress Format table, or use Ctrl+Enter (Cmd+Enter on macOS).
  4. Copy or downloadCopy the result, or download it as a .md file.

Worked examples


Each example below is executed against this tool by the test suite, so what you see is what the tool actually produces.

A ragged table aligned

Input

|Name|Role|
|-|:-:|
|Ada|Engineer|
|Bob|Designer|

Output

| Name |   Role   |
| ---- | :------: |
| Ada  | Engineer |
| Bob  | Designer |

Columns are padded to a consistent width, and the centre-alignment marker is kept.

What to watch for


The details that decide whether a conversion is correct, and where information can be lost without any error being raised.

Column width comes from the longest cell
Each column is padded to its widest value, including the header, with a minimum of three characters so the separator row stays valid. The rendered output is unchanged, only the source text is tidied.
Alignment markers are preserved
The colons in the separator row control rendered alignment: :--- is left, ---: is right, and :---: is centre. Those are kept, and cell contents are padded to match, so a right-aligned column reads correctly in the source too.
Escaped pipes are handled
A pipe inside a cell must be written as \| or it would be read as a column separator. Escaped pipes are recognised and preserved rather than splitting the cell.
Ragged rows are padded
A row with fewer cells than the header gets empty cells appended, so every row has the same column count. That usually reveals a row that was accidentally left short.

Limitations


  • Requires a valid table with a separator row.
  • Wide-character text such as CJK may still appear uneven in a proportional font.
  • Processing happens in your browser, so very large inputs are bounded by available memory. Files above roughly 10 MB are handled but will feel slower, and multi-hundred-megabyte files are better suited to a command-line tool.

Questions


Does this change how the table renders?
No. Markdown ignores the extra padding, so the rendered table is identical. Only the source becomes readable.
What if a cell contains a pipe?
Write it as \|. Escaped pipes are recognised and preserved rather than treated as column separators.