Markdown Formatter: Format Markdown Online with Prettier
Markdown Formatter normalizes Markdown in your browser and proves the result still says what your input said before it shows it. Paste or drop a document, pick a preset or adjust the options, and format lists, tables, headings, emphasis, code blocks and prose wrapping — with a structure-aware layer for bullet characters, heading levels, fence styles, ragged tables and the invisible characters that come with pasted text. Fenced code blocks can be formatted by the matching tool in this site, YAML front matter by the YAML beautifier, and the dialects Prettier would restructure can be protected instead. Beside the Code view are a sandboxed Preview, an Outline with a generated table of contents, a Tables view, a Diff against your input, and an Info & Issues view that lints the document with markdownlint’s rules and applies fixes.
Markdown Formatter formats Markdown entirely in your browser and proves the result before showing it: the output is parsed again as a document tree and rendered as HTML, both are compared with your input, and if the document would change, the original text is kept and the difference explained. Prettier’s Markdown printer is the back-end, so the output matches what a README, a docs site or a repository already formatted with Prettier expects.
A structure-aware layer covers what Prettier’s Markdown printer has no option for: bullet characters, the ordered-list delimiter, emphasis and strong markers, heading style and level fixes, fence characters, thematic breaks, hard-break style, ragged-table padding, unicode bullets and invisible characters. A conversion that would fuse two adjacent lists is refused rather than performed, and the Info & Issues view re-checks the style choices with markdownlint’s own rules. Fenced code blocks can be formatted by the matching tool in this site, YAML front matter by the YAML beautifier, and dialect protection keeps the constructs Prettier is known to restructure — MkDocs admonitions (!!! and ???), ::: directive containers, GitHub alerts and Obsidian callouts, multi-line Hugo shortcodes, and a leading rule that would otherwise read as front matter — exactly as written.
Six views work from the same text, so nothing has to be copy-pasted between them: Code, a Preview that renders the document in a sandboxed iframe, an Outline with a generated table of contents, a Tables view that checks the alignment row and the pipe escaping of every GFM table, a Diff against your input, and Info & Issues, which lints the document, explains each issue with its line, column and rule, and applies fixes. Large documents are parsed in pieces instead of in one pass, the formatter runs in a Web Worker above 300 KB, and the panels that are not free on a huge file — outline, tables and checks — stand down above 2 MB while the formatter and the diff keep working.
Markdown looks forgiving, and a few of its rules are not: two trailing spaces are a hard line break, a blank line does not separate two lists that use the same marker, the words 1986. and # are not a list and a heading, and a --- before the text is front matter rather than a rule. The formatter leaves escapes, reference links, footnote definitions, math, HTML blocks, comments and prettier-ignore regions as written, and says so when it cannot do something safely. MDX is one such case: components here are treated as raw HTML, so a .mdx file belongs in the MDX Formatter. Everything runs locally — your input is processed on your device and is not uploaded, stored or sent to a server — the tool is free, and once the page has loaded it works offline. Developers, technical writers and reviewers use it to prepare documentation, clean up generated Markdown, and hand a reviewer a diff that is about content rather than whitespace.
Step 1: Paste or drop your Markdown into the editor, or open one of the sample documents: a messy README, a table with CJK text and escaped pipes, front matter, code fences, pasted AI output.
Step 2: Take a preset — Default, Wrap prose at 80, Four-space list indent, Windows line endings, Join prose lines, Format code blocks too, Jekyll or Hugo post, GitHub house style, Clean up AI output, Typographic — or set the options yourself: list indent, print width, prose wrap, line endings and the list, emphasis, heading, fence, rule and hard-break styles.
Step 3: Turn on what the document needs: format fenced code blocks with the matching tool, format YAML front matter, protect dialect constructs such as MkDocs admonitions, ::: containers, GitHub alerts and Hugo shortcodes, and leave the verification on.
Step 4: Read the views: Code, a sandboxed Preview that renders the document, Outline with a copyable table of contents, Tables with alignment warnings, Diff against your input, and Info & Issues. The badge above the output says whether the result verifies as the same document — if it would change your document, the original text is kept and the difference is explained.
Step 5: Copy or download the result, or export the settings you used as .prettierrc, .markdownlint.json, .editorconfig and a Prettier CLI command so the next run in your editor or CI matches.
Use case: Make a README or documentation page consistent before a review: nested lists, tables, emphasis and headings are normalized, and the Diff view shows that only whitespace and markers moved.
Use case: Normalize the bullet character, the ordered-list delimiter, the emphasis and strong markers and the heading style across a repository — a conversion that would make two adjacent lists merge into one is refused rather than performed.
Use case: Format the code inside fenced blocks with the JavaScript, TypeScript, JSON, CSS, YAML, SQL or HTML formatter in this site. A block that does not parse is left exactly as written and reported with its line number.
Use case: Clean up text pasted from an AI chat: unicode bullets become real list items, curly quotes are straightened, invisible characters are removed, and bare URLs are wrapped as links.
Use case: Protect the constructs Prettier restructures — MkDocs admonitions, ::: directive containers, GitHub alerts and Obsidian callouts, multi-line Hugo shortcodes — so a docs site keeps rendering them the way it did.
Use case: Lint a document with markdownlint’s rules and fix what it finds, one issue at a time or all at once: heading levels, duplicate headings, list markers, fence style, table pipe style and broken link fragments.
Use case: Format a Jekyll or Hugo post: the YAML front matter is formatted by the YAML beautifier with its own verification, and the Outline view generates a table of contents you can paste into the post.
Use case: Pin the result in a project by exporting .prettierrc, .markdownlint.json, .editorconfig and a Prettier command line derived from the options you just used, so your editor and CI format Markdown the same way.