Skip to content
ZeroServer.tools

Markdown Table Formatter

Format and align messy Markdown tables. Automatically pads columns to equal widths and preserves left, right, and center alignment.

Input (Messy Table)
Formatted Output
Characters: 0

About the Markdown Table Formatter

Markdown tables are notoriously hard to read when column widths are uneven. This formatter parses your GitHub Flavored Markdown (GFM) table, calculates the maximum width for each column, and pads every cell so columns are perfectly aligned. Left, right, and center alignment (specified via the separator row with :---, ---:, or :---:) is preserved. Useful for keeping source code readable and for documentation that is reviewed as plain text.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Tidying a table you have been editing by hand, where the pipes stopped lining up several rows ago.
  • Making a generated table readable in the source as well as the rendered output.
  • Adding a column to an existing table without realigning every row manually.
  • Normalising tables across a document so the diff on the next edit is small.
  • Checking that alignment markers are where you think they are before publishing.

Frequently Asked Questions

Does the alignment of pipes actually matter?
Not to the renderer — GitHub Flavored Markdown parses ragged pipes identically. It matters entirely for the SOURCE being readable and for producing clean diffs, which is the real reason to format tables.
How is column alignment set?
In the separator row, with colons: :--- is left, :---: is centre, ---: is right. The number of dashes is irrelevant. Omitting the colons leaves alignment to the renderer's default, usually left.
How do I put a pipe character inside a cell?
Escape it as \| — an unescaped pipe splits the cell and shifts every column after it. Inside backtick code spans it still needs escaping in GFM, which surprises people.
Can a cell contain multiple lines?
No. Markdown tables are strictly one row per line, so a line break inside a cell requires an HTML <br> tag. Genuinely multi-line content is a sign the data does not belong in a Markdown table.
Are tables part of standard Markdown?
No — the original spec has no tables. They come from GitHub Flavored Markdown and are now widely supported, but a strict CommonMark renderer will output the pipes as literal text.
How are wide characters handled when aligning?
Padding is counted in characters, but CJK glyphs and emoji occupy two terminal columns, so a table that lines up by character count can still look ragged in a monospace view. The rendered HTML is unaffected either way.
Is there a column or row limit?
No limit in the syntax, but a wide table overflows its container on mobile and pipe tables cannot scroll on their own. Past roughly six columns, a definition list or several smaller tables usually reads better.

Common errors and gotchas

  • Forgetting to escape a literal pipe inside a cell, which splits it into two columns silently.
  • Having a different number of cells in one row, which most renderers pad or truncate without complaint.
  • Assuming alignment colons are decorative. They control rendering, and moving one changes the output.
  • Relying on source alignment for rendering. Renderers ignore the padding entirely; it is for humans reading the diff.
  • Putting a line break inside a cell, which ends the row as far as the parser is concerned.

Related Text Tools tools

Private & free — this tool runs entirely in your browser.