String Utilities Tool aktualisiert vor 22 Stunden

Markdown Table Formatter

Markdown Table Formatter takes the first pipe table in your input and rewrites it with padded, evenly aligned columns, consistent outer pipes and normalised alignment markers (---, :---, ---:, :---:). Short rows are padded with empty cells and a live preview shows the rendered table. Formatting runs in your browser; copy the result or download markdown-table-formatted.md.

Immer kostenlos Einfach zu bedienen Sofortige Ergebnisse Privat und sicher

Verwendung Markdown Table Formatter

Markdown Table Formatter

Format messy Markdown tables into aligned, readable, copy-ready table syntax.

Input Markdown Table

Paste a Markdown table block to format
Formats the first detected table block. Separator rows like ---, :---, ---:, and :---: are supported.
No table detected
Table status
0 × 0
Rows × columns

Formatted Output

Aligned Markdown table

Preview

Visual preview of the formatted table
Waiting
Format a table to preview it here.
Formatter tip
This tool formats the first detected Markdown table block. It preserves alignment markers and pads cells for cleaner editing.
Tool-Link
In die Zwischenablage kopiert.
Helfen Sie mit, dieses Tool zu verbessern

Inhalt lesen

Erfahren Sie, wie das Tool funktioniert und wann Sie es einsetzen sollten.

Turn a crooked pipe table into a tidy one

Markdown tables render fine even when the source is a mess, but the raw text is a different story. Cells drift out of line, some rows have trailing pipes and some do not, and the separator row is a jumble of dashes and colons. The Markdown Table Formatter fixes the source. Paste a table, click Format, and you get back the same data with every column padded to the same width, every row wrapped in pipes, and a normalised alignment row, plus a rendered preview so you can check the result at a glance.

Formatting changes only spacing and the shape of the separator. Cell text is not rewritten, sorted or reordered, so the table means exactly what it meant before.

Before and after

A typical hand-typed table:

Tool|Language|Stars
:---|:---:|---:
Pandoc | Haskell|35k
|markdown-it|JavaScript|18k|

After clicking Format:

| Tool        | Language   | Stars |
| :---        | :---:      | ---:  |
| Pandoc      | Haskell    | 35k   |
| markdown-it | JavaScript | 18k   |

Every column is now as wide as its longest entry, the outer pipes are consistent, and the alignment markers survive: the first column stays left aligned, the second centred and the third right aligned. One rule to remember is that separator cells need at least three dashes to be recognised. A row written as :--|:-:|--: is treated as ordinary data, so use three or more dashes per cell and the formatter will take care of the rest.

What the formatter does, rule by rule

  • Finds the first table block. It scans from the top for the first line that contains a pipe with text on both sides, then takes every following line until it meets a blank line or a line with no pipe.
  • Splits rows into cells. Leading and trailing pipes are dropped, the line is split on every pipe, and each cell is trimmed of surrounding spaces.
  • Evens out row lengths. The row with the most cells sets the column count. Shorter rows are padded with empty cells so every row has the same number of columns.
  • Normalises the separator. Any row whose cells are all three or more dashes, with optional colons, is rewritten using four standard markers: --- for default, :--- for left, ---: for right and :---: for centre alignment.
  • Pads each column. Every column is as wide as its longest cell, with a minimum width of three characters, and shorter cells are padded with spaces on the right.
  • Rewraps rows. Each line becomes | cell | cell | cell | with one space either side of each pipe.

The work happens in your browser using JavaScript on the page. Nothing is sent to the server when you click Format, copy or download.

Reading the screen

The input card is called Input Markdown Table and shows character and line counts underneath. Two small status cards sit to its right: the first switches between No table detected and Table detected as you type, and the second shows the shape as rows × columns. The row figure counts every line in the block, including the separator line. The Formatted Output card holds the result in a read-only editor with its own character and line counts. Below that, the Preview card renders the formatted table as a real HTML table, with the badge changing from Waiting to Preview ready. The first row is shown as the header and the alignment from the separator row is applied to each column.

How to format a table

  1. Paste your table into Input Markdown Table, or press Paste at the top of the page.
  2. Confirm the status card says Table detected and that the rows × columns figure looks right.
  3. Press Format. If no table is found you will see a short warning and the output stays as it was.
  4. Check the Preview: column headings in the first row, alignment where you expect it, no shifted cells.
  5. Press Copy Table to copy the result, or Download to save it as markdown-table-formatted.md.
  6. Paste the formatted table back into your document in place of the old one.

Copy Input copies whatever is in the input editor, and Clear empties input and output and resets the preview.

Important: the output is the table only

You can paste a whole document into the input, and the formatter will find the first table in it. The output, however, contains only that formatted table. Paragraphs, headings and any later tables are not copied to the output. This is by design, since the tool is meant for one table at a time, but it means you should paste the result back into your document yourself rather than replacing the whole file with the output.

If your document has several tables, format them one by one: paste each table on its own, format, copy, and put it back.

Situations where it helps most

  • Pull requests and code review. Aligned tables in README files and docs produce cleaner diffs and are easier to review in plain text.
  • Tables exported from spreadsheets or chat tools. Converters often emit valid but cramped rows. One pass makes them readable.
  • Keeping a consistent house style. Every table ends up with outer pipes, single spaces and the same four separator markers.
  • Spotting missing cells. Because short rows are padded with empty cells, a row that was missing a value shows up as an obvious blank in the preview.

Things to avoid

  • Escaped pipes and pipes inside code. The formatter splits on every pipe character. A cell like a \| b or `x | y` is split into two cells, which shifts the rest of the row. Rewrite such cells before formatting or fix them afterwards.
  • Blank lines inside the table. A blank line ends the block, so rows after it are ignored.
  • Two-dash separators. Write at least three dashes per separator cell, otherwise the row is formatted as data.
  • Expecting perfect alignment with wide characters. Column width is measured in JavaScript string length. Emoji, Chinese, Japanese or Korean characters take up more screen width than their length suggests, so columns containing them can look uneven in a monospace editor even though the Markdown is valid.

Limitations

  • Only the first table block in the input is formatted, and only that table is returned.
  • Pipe tables only; HTML tables and other table syntaxes are not recognised.
  • A separator row is not required for formatting, but without one the table will not render as a table in most Markdown viewers. The preview still shows the first row as a header.
  • Cell content is not escaped, wrapped or shortened. Very long cells make very wide columns.
  • No fixed size limit is set in the code; very large tables are limited by your browser's speed and memory.

Related tools

Need a fresh table rather than a cleanup? The Markdown Table Generator creates an empty grid of any size up to 50 rows and 20 columns. If you want tables out of a document altogether, use Markdown Remove Tables.

Frequently Asked Questions

Häufig gestellte Fragen

Kurze Antworten auf die Fragen, die Nutzer stellen, bevor sie dem Ergebnis vertrauen.

No. It trims spaces around each cell, adds padding and normalises the separator row. The text inside cells, the order of rows and the order of columns stay the same.

You can, but only the first table block is formatted and the output contains only that table. Format other tables one at a time and paste each result back into your document.

Left, right, centre and default alignment are all kept. They are rewritten as :---, ---:, :---: and --- and padded to the column width.

The row with the most cells sets the column count, and shorter rows are padded with empty cells so the table stays rectangular. Missing values become visible blanks in the preview.

The formatter splits on every pipe character, including escaped pipes and pipes inside inline code. Replace those pipes or reformat the cell by hand after running the tool.

No. Detection, formatting and the preview all run in your browser with JavaScript on the page, and the download is created locally.

The Download button saves the formatted table as markdown-table-formatted.md in UTF-8.

Kommentare (0)

Für Nutzerdiskussionen, Sonderfälle und weitere Tipps.
Einen Kommentar hinterlassen
Ihr Kommentar wird nach dem Absenden öffentlich angezeigt.
Noch keine Kommentare. Schreibe den ersten Kommentar!
Teilen Sie es uns mit!
Ein Problem mit diesem Tool melden

Beschreiben Sie das aufgetretene Problem, damit wir es untersuchen und das Tool verbessern können.

Was am meisten hilft
Geben Sie die Eingabe, das erwartete Ergebnis, das tatsächliche Ergebnis, den Browser bzw. das Gerät sowie gegebenenfalls einen Screenshot an.
Die Schaltfläche „Screenshot“ erfasst die Seite im Browser und fügt das erzeugte Bild diesem Formular als Anhang hinzu.
Ganzseitiger Screenshot
Mit newisty in Ihrem Browser erfasst.
Es wurde noch kein Screenshot aufgenommen.
Werkzeug Bericht