Boneyard Tools

Markdown Table Formatter

Paste a messy Markdown table and get a clean one back. Columns are padded to an equal width, the separator row is rebuilt, and pipes get single spaces, so the raw Markdown is easy to read and diff. Alignment markers are kept by default.

How to format a Markdown table

  1. Paste your Markdown table, including the header and separator (dashes) rows.
  2. Leave alignment on Preserve to keep each column's markers, or force left, right, or center.
  3. Copy the aligned Markdown or download it as a table.md file.

Examples

Align a messy table

|a|b|
|-|-|
|longvalue|2|
| a         | b   |
| --------- | --- |
| longvalue | 2   |

Preserve per-column alignment markers

| L | C | R |
| :-- | :-: | --: |
| a | b | c |
| L   | C   |   R |
| :-- | :-: | --: |
| a   | b   |   c |

Frequently asked questions

What does formatting a Markdown table do?

It lines up your columns. Each cell is trimmed, every column is padded to the width of its widest value, and the separator row is rebuilt with matching dashes. The rendered table looks the same, but the raw Markdown is readable and produces cleaner diffs.

Does it keep my column alignment?

Yes. With alignment set to Preserve, the tool reads the markers in your separator row and keeps them: :-- stays left, --: stays right, and :-: stays centered. You can also force one alignment for every column.

What input does it expect?

A GitHub Flavored Markdown table: a header row, a separator row of dashes like | --- | --- |, then your data rows. Leading and trailing pipes are optional. If the separator row is missing, the tool reports an error instead of guessing.

What happens to escaped pipes in a cell?

A literal pipe written as \| stays inside its cell and does not start a new column, so code and text that contain pipes survive the reformat unchanged.

Why are short columns padded to three characters?

A separator needs at least three dashes to be valid Markdown, so single-character columns are widened to three. This keeps the syntax correct and the columns aligned everywhere the table renders.

Is my data private?

Yes. The whole table is formatted in your browser and nothing is uploaded to a server, so your data never leaves your device.

Related tools