Markdown Whitespace Cleaner
100% CLIENT-SIDE
Raw Markdown Input
Cleaned Markdown
More from MarkdownTidy
Markdown Table Formatter
Align GitHub-flavored Markdown pipe tables: every column padded to its widest cell, alignment colons kept,…
Markdown Linter for Rendering Surprises
Find Markdown that renders differently from how it reads: #Heading with no space, a --- line that turns a…
Guides
Frequently Asked Questions
Is my data safe on markdowntidy.net?
Yes. Formatting and linting happen entirely in your browser, so drafts are never uploaded.
Can it align messy pipe tables?
Yes, on the table formatter page. It pads each column to its widest cell and rebuilds the separator row, keeping alignment colons, which keeps tables readable in raw form and produces clean diffs. Tables inside code fences are left alone, and a table with a row wider than its header is left as written.
Will it rewrite my content?
No. The home page only removes trailing whitespace and blank lines at the ends, and the table formatter only changes table padding. Prose, links, list markers and code-block contents are left as written. Note that trimming deletes the two trailing spaces Markdown reads as a hard line break.
🧭 Pro Tips & Gotchas
What this does
- Removes trailing spaces from every line and trims trailing blank lines. Nothing else changes — including the two spaces that carry meaning in Markdown.
The one whitespace rule that matters
- Two trailing spaces = a hard line break. Trailing-whitespace trimmers delete them and silently turn your poem, address block, or changelog into one wrapped paragraph. Check whether those two spaces were intentional before tidying;
prettier --parser markdownwill convert them to a backslash hard break, which survives trimming. - Set
no-markdownin your.editorconfig/trim-on-save config for.mdfiles, or add*.md: trim_trailing_whitespace: false. This is the setting people discover after a bad diff.
Markdown gotchas
- Blank lines are structure, not decoration: two list items with a blank line between them render as a loose list (each
<li>wrapped in<p>), which changes spacing and breaks CSS that assumes tight lists. - Nested list indentation is renderer-dependent: 2 spaces works in most CommonMark renderers, 4 is safest, 1 fails. GitHub and CommonMark disagree on some legacy indent styles.
1.is normalised to the first number by most renderers, so an ordered list written3. 4. 5.may render1. 2. 3.. Usestart=in HTML or accept it.- ATX headings need a space:
#Titleis not a heading in CommonMark (GitHub renders it literally). Setext headings (===/---under text) are fragile — a stray---under a paragraph turns the paragraph into a heading. - Tables need the leading and trailing pipes and a separator row; a missing pipe on one row silently makes the whole table render as plain text.
- Fenced code blocks: the info string must not contain backticks, and a fence inside a fence needs more backticks than the outer one. Four-backtick outer fences are the reliable fix.
- Autolinks are not links.
<https://example.com>works, bareexample.commay or may not be linkified depending on the renderer, and a URL containing)needs angle brackets to survive.
Developer Sponsor / Partner