Markdown formatter
Paste messy markdown and get a consistently formatted version back: uniform list markers, one emphasis style, aligned tables, and normalized spacing. The formatter parses your document and re-prints it, so the rendered result never changes — only the source gets cleaner.
Input
14 linesFormatted
Formatting is semantic: the document is parsed and re-printed, so the rendered result is identical — only the source style changes. Runs fully in your browser.
What gets normalized
- List markers — a document mixing
-,*, and+bullets comes out using one marker of your choice, with consistent indentation for nested lists. - Emphasis style —
*asterisks*and_underscores_render identically, but mixing them in one file reads badly. Pick one; the formatter applies it everywhere, to bold too. - Tables — cells get padded so pipes line up vertically, the same formatting our table generator produces.
- Headings — setext headings (underlined with
===) become ATX headings (#), and stray spaces after the hashes are removed. - Spacing — extra blank lines collapse, and blocks are separated by exactly one blank line, which some renderers require.
Semantic formatting, not find-and-replace
The formatter is built on remark, the same parser used by Prettier's markdown support and thousands of documentation pipelines. Your text is parsed into a syntax tree and printed back out — which is why it can safely tell the difference between a * that starts a list item and a * inside a sentence, or between an underscore in variable_name and one that starts emphasis. A regex-based beautifier can't make those distinctions; a parser can.
One consequence worth knowing: because the output is re-printed from the tree, insignificant quirks of your original source (trailing whitespace, inconsistent escape styles, indented vs. fenced code) are normalized to the standard form. If some exotic construct matters to your toolchain, diff the output before committing it.
When to use it
- Before committing docs — a formatted README diffs cleanly in code review because only real changes show up, not style noise.
- After AI generation — LLM-generated markdown often mixes emphasis markers and bullet styles mid-document; one pass here fixes it.
- Merging docs from multiple authors — unify everyone's habits into one house style.
- Cleaning up exports — Notion, Google Docs, and other exporters produce technically-valid but ugly markdown.
FAQ
Will formatting change how my document renders?
No — that's the core guarantee. The document is parsed and re-printed, so the HTML any renderer produces from the output is the same as from the input. The only changes are to the plain-text source.
Does my text leave the browser?
No. Parsing and printing run entirely client-side. Nothing is uploaded, logged, or stored.
Can I enforce this style automatically in a repo?
Yes — add Prettier (which formats .md files out of the box) or remark-cli with remark-preset-lint-consistent to your CI. This tool is the zero-setup version of the same idea.
Why did my HTML comment / footnote survive untouched?
Inline HTML and GFM footnotes are preserved verbatim — the formatter only restyles constructs it fully understands.
More markdown tools
Markdown to HTML · Markdown to PDF · README generator · Cheat sheet · Share markdown as a link