Markdown formatter

Clean up messy Markdown with Prettier: consistent lists and headings, aligned tables, tidy spacing and an optional table of contents.

Already tidy

What gets normalised

BeforeAfter
*, +, - mixed bullets- everywhere (alternating in adjacent lists)
__bold__, *italic***bold**, _italic_
Underlined === headings# ATX headings
1) numbering1. numbering
Ragged tablesPadded columns that respect alignment colons
Missing or extra blank linesOne blank line between blocks
Unlabelled fencesKept as they are (no language is guessed)

Why format Markdown?

Markdown renders the same whether you use * or -, but mixed styles make diffs noisy and documents harder to maintain. Teams usually settle on one style with a linter such as markdownlint and a formatter such as Prettier in their editor or pre-commit hook. This page gives you the same result without setting anything up.

Table of contents

The generated TOC links to each heading with GitHub-compatible anchors, so it works on GitHub, GitLab and most static site generators. It sits between <!-- toc --> and <!-- tocstop --> comments (the same markers the popular markdown-toc tool uses), so running the formatter again replaces it instead of adding a second one.

Questions people ask

What does the Markdown formatter change?
It uses Prettier’s Markdown formatter to normalise list markers, emphasis style, heading style, blank lines, code fences and table alignment. The words are never changed.
Will it break my code blocks?
No. Content inside fenced code blocks is left exactly as it is.
What does “Wrap prose” do?
“Always” hard-wraps paragraphs at your chosen width, useful for docs reviewed in git diffs. “Never” joins each paragraph onto one line. “Preserve” keeps your line breaks.
How do I generate a table of contents?
Tick “Insert / update table of contents”. A linked list of your H2 and H3 headings is added after the title between <!-- toc --> markers; run it again later to refresh it.
Is it the same as running Prettier locally?
Yes, it is Prettier 3 running in your browser, so the output matches npx prettier --write file.md with the same options.

Related tools