Markdown Table Formatter
Loading converter…
Before & After Formatting Example
Input: Messy Markdown Table
|Product|Price|Rating|
|:--|--:|:-:|
|Laptop|$999|4.8|
|Phone|$799|4.7|
|Wireless Headphones|$149|4.5|Output: Formatted Markdown Table
| Product | Price | Rating |
| :------------------ | ----: | :----: |
| Laptop | $999 | 4.8 |
| Phone | $799 | 4.7 |
| Wireless Headphones | $149 | 4.5 |:--, --: and :-: markers decide how each column is padded: left, right and centered.How to Format a Markdown Table
Paste your table
You can paste a single table or a whole
.mddocument.Check the output
Columns are padded to the widest cell, and the separator row is rebuilt to match.
Copy or download
Paste the result back into your README, wiki or docs.
What the Formatter Fixes
| Problem in your table | What the formatter does |
|---|---|
| Ragged columns, pipes not lined up | Pads every cell to the widest value in its column |
| Separator row too short or too long | Rebuilds it to match the column widths |
Alignment markers (:---, :---:, ---:) | Keeps them and pads cells to match |
| Missing leading or trailing pipes | Adds them so every row has the same shape |
| Rows with fewer cells than the header | Fills the gaps with empty cells |
| Rows with more cells than the header | Keeps every cell and adds empty header columns for them |
| Text outside tables, and tables inside code fences | Left unchanged |
Edge Cases That Break Tables
Pipe characters inside a cell
| ends the cell, so everything after it shifts into the next column. Escape it with a backslash. GitHub Flavored Markdown applies the escape even inside inline code, and the formatter keeps \| as cell content.\| even inside inline code.| Command | Meaning |
| :------- | :------------- |
| `a \| b` | a piped into b |Rows with too many or too few cells
Input:
| A | B |
|---|---|
| 1 |
| 2 | 3 | 4 |
Output:
| A | B | |
| --- | --- | --- |
| 1 | | |
| 2 | 3 | 4 |Line breaks inside a cell
<br> for a line break; the formatter leaves it untouched.| Step | Detail |
| :---- | :-------------------------- |
| Setup | Install the CLI<br>Run init |Emoji and CJK characters
| 名前 | Status |
| ------ | ------ |
| 日本語 | ✅ |Proportional fonts
Tables pasted from ChatGPT, Notion or Excel
| --- | --- | row under the header, then format, and spot-check any cell that contained a |.| Name | Role |
| --- | --- |
| Ana | Dev |Formatter or Generator?
| Table Formatter | Table Generator | |
|---|---|---|
| You start with | A Markdown table you already have | Nothing, or CSV/spreadsheet data |
| It does | Cleans spacing and alignment | Builds a new table in a grid |
| Pick it for | README and docs cleanup | Writing a table from scratch |
Starting from scratch? Use the Markdown Table Generator. Starting from a spreadsheet? Try Excel to Markdown Table or CSV to Markdown Table.
Frequently Asked Questions
- 1
Does it keep my column alignment (
:---,:---:,---:)?Yes. Left, center and right markers are kept, and the cells are padded to match.
- 2
How do I put a
|inside a cell?Write
\|. Without the backslash, the pipe is read as a column separator and the rest of the row moves one column over. - 3
What happens to rows with a different number of cells?
Short rows are filled with empty cells. Rows with extra cells keep them, and the formatter adds empty columns to the header and separator to fit. GitHub alone would ignore those extra cells, so check long rows before publishing.
- 4
Can I put a line break in a table cell?
Use
<br>. A literal line break would end the row, because table rows must stay on one line. - 5
Why do my columns still look uneven after formatting?
Your editor is probably using a proportional font, or the table has emoji or CJK characters. Check it in a monospace font.
- 6
Is my table sent to a server?
No. Formatting runs entirely in your browser, and your table is never uploaded.
- 7
Does it format tables inside code blocks?
Fenced code blocks (``` or ~~~) are left as they are. Indented code blocks are not skipped.
Related Tools
People also convert
Last updated: Category: Markdown Table Tools
