Markdown Formatter
Normalise Markdown syntax — list markers, headings, emphasis and tables — without rewrapping your paragraphs.
Your Markdown
Formatted Markdown
Markdown is permissive to a fault. Three different characters start a bullet, two syntaxes produce a heading, underscores and asterisks both produce emphasis, and a table renders the same whether or not its pipes line up. Any single document written by several people over a couple of years accumulates all of these variants at once, and although it still renders correctly, editing it is unpleasant and reviewing a diff of it is worse.
This page runs Prettier 3.9.6 with its Markdown parser, in your browser. It normalises the syntax without touching your words. That distinction matters and is spelled out below: Prettier is configured here with its default proseWrap behaviour, which preserves your existing paragraph line breaks rather than reflowing your sentences to a column limit.
How to use the markdown formatter
- 1
Paste your Markdown
A README, a changelog, a runbook, a docs page or documentation exported from another tool. Files with YAML front matter are fine. The Markdown parser is one of the smaller Prettier plugins, so the first load is quick.
- 2
Choose indentation
This controls the indentation used for nested list items and for content inside list items. Two spaces keeps nested lists compact; four matches some older linters that require it for unambiguous nesting.
- 3
Copy or download
Copy Markdown puts the normalised source on your clipboard; Download saves a
.mdfile. Diff it against the original if you are committing a bulk reformat, so reviewers can see it is syntax-only.
What gets normalised
Prettier picks one form for each construct that Markdown allows to be written several ways:
- Headings. Setext headings — the ones underlined with
===or---— are converted to ATX form with leading#characters, so all six levels use one consistent syntax. - Bullet markers. Mixed
*,+and-bullets become a single consistent marker, and nested lists indent by your chosen width. - Ordered lists. Numbering is normalised. Prettier looks at the first two items: if they use the same number it keeps them all identical, and otherwise it renumbers them in sequence. Either way the mess of
1),1),3)becomes something coherent. - Emphasis. Italic is printed with underscores and bold with double asterisks, so
*word*and__word__converge on one style each. - Tables. Column pipes are padded so they align in the source, and the alignment row keeps your
:--,:-:and--:markers. This is the single biggest readability improvement in most documents. - Blank lines and trailing whitespace. Runs of blank lines collapse to one, and trailing spaces are removed — except a deliberate two-space hard line break, which is meaningful and preserved.
- Escaping. Characters that would otherwise be read as syntax are escaped where necessary so the rendered output is unchanged.
Your prose is not rewrapped
Prettier's proseWrap option defaults to preserve, and that default is used here. Your paragraph line breaks stay exactly where you put them. A paragraph written as one very long line stays one very long line; a paragraph hand-wrapped at 72 columns keeps its breaks.
This is the right default for anything under version control. Reflowing prose to a fixed width means that inserting a word near the start of a paragraph re-wraps every line after it, turning a one-word change into a twenty-line diff. Preserving breaks means the "one sentence per line" convention, which many documentation teams adopt precisely to get clean diffs, keeps working.
The consequence is that this formatter will not tidy a paragraph you consider too wide. That is deliberate, not a limitation. If you want a specific wrap width, do it in your editor, where you can choose paragraph by paragraph.
Code blocks, front matter and embedded HTML
Fenced code blocks are preserved byte for byte — the content, the fence characters and the language label are all untouched. Their contents are not reformatted here, because formatting an embedded JavaScript block would require loading the JavaScript parser as well, and this page loads only the Markdown plugin so it stays small. Indented four-space code blocks are also preserved as written.
YAML front matter delimited by --- at the top of the file is left as it is. If you want the front matter itself tidied, run that block through the YAML formatter separately.
Raw HTML embedded in Markdown — a <details> block, a table written in HTML because Markdown tables cannot do rowspans, or an <img> tag with a width attribute — is passed through unchanged. Reference-style links and their definitions are kept, and definitions stay where you placed them. Footnotes, task list checkboxes and GitHub-flavoured strikethrough are all handled.
Markdown Formatter FAQ
Will it rewrap my paragraphs to 80 columns?
No. The proseWrap setting is left at its default of preserve, so your existing line breaks inside paragraphs are kept. Only syntax is normalised; the flow of your text is yours.
Does it format code inside fenced blocks?
No. Fenced block contents are preserved exactly. Formatting embedded code would mean loading a parser per language on a page whose whole appeal is being lightweight. Paste the block into the matching formatter — JavaScript, TypeScript, CSS, JSON — if you want it tidied.
Is GitHub-Flavored Markdown supported?
Yes. Tables, task lists, strikethrough, autolinks and footnotes are all recognised and formatted. Fenced code blocks with language labels work as expected.
What happens to my YAML front matter?
It is left alone. The delimiters and the content between them pass through unchanged. Use the YAML formatter on that block if it also needs tidying.
Why did my numbered list get renumbered?
Prettier inspects the first two items to infer your intent. If both use 1. it treats that as the deliberate "all ones" style and keeps it; if they differ it renumbers the list in sequence. Either way the rendered output is identical, since renderers number ordered lists themselves.
