Free Markdown Formatter — Clean and Normalize Markdown Online
Clean and normalize messy markdown automatically
Formatting rules, with before and after
Every rule the beautifier applies, shown on a small example. Nothing inside a fenced code block is touched.
| Rule | Before | After |
|---|---|---|
Space after heading hashes Without the space, most renderers show literal ## text. | ##Install | ## Install |
Closing heading hashes | ## Install ## | ## Install |
Blank lines around headings | Intro text ## Install Run this: | Intro text ## Install Run this: |
Blank lines around code fences | Run this: ```bash | Run this: ```bash |
Collapse blank-line runs Three or more blank lines become two. | Para one Para two | Para one Para two |
Space after list marker | -item *item | - item * item |
Renumber ordered lists Nested lists are numbered per indent level. | 1. one 1. two 5. three | 1. one 2. two 3. three |
Unify bullet style (opt-in) Off by default, because it is a style choice. | * one + two | - one - two |
Link syntax The space stops the link from rendering. | [docs] (https://x.dev) | [docs](https://x.dev) |
Space after blockquote marker | >Note | > Note |
Trailing whitespace · marks a trailing space. | line·· | line |
Line endings and final newline | CRLF, no final newline | LF, ends with one newline |
What the formatter fixes
- Heading spacing and surrounding blank lines
- Ordered-list numbering and list marker spacing
- Runs of extra blank lines
- Broken link syntax and blockquote spacing
- Trailing whitespace and line endings
How it works
Paste your markdown and click Format. The tool applies normalisation rules and shows a before/after diff so you can see exactly what changed.
The formatter is non-destructive. It only changes whitespace, markers, and numbering, never your content. To check structure such as skipped heading levels or missing alt text, use the markdown linter.
Common use cases
- Cleaning up AI-generated markdown output
- Normalising docs before committing to git
- Fixing inconsistent list styles across a team
- Preparing markdown for PDF export
Frequently asked questions
Quick answers about formatting rules, privacy, and how this compares with Prettier and markdownlint.
What markdown formatting issues does this tool fix?
Missing spaces after heading hashes, list markers, and blockquote markers; closing hashes on headings; missing blank lines around headings and code fences; runs of three or more blank lines; misnumbered ordered lists; a space between ] and ( in links; trailing whitespace; CRLF line endings; and a missing final newline. Each rule can be switched off.
Will the formatter change my text content?
No. It only changes whitespace, markers, and numbering. Words, links, images, and everything inside fenced code blocks are left exactly as they are.
Can I see exactly what changed after formatting?
Yes. The formatter shows a before/after diff and the number of fixes applied, so you can review the result before copying it.
How do I fix markdown that came out of ChatGPT or Claude?
Paste it in and format. AI output often has headings glued to the paragraph above, lists numbered 1. 1. 1., and stray trailing spaces. Those are the cases this formatter targets.
Is this the same as running Prettier on a markdown file?
It is similar in intent but narrower. Prettier also rewraps prose and rewrites emphasis and table formatting. This formatter applies a small set of fixes you can toggle one by one, runs in the browser, and needs no install or config file. For a repo, Prettier or markdownlint --fix in CI is the better choice.
Is my markdown uploaded anywhere?
No. Formatting runs entirely in your browser. Nothing is sent to a server.
Once formatted, you can export to PDF or verify the result in the live editor.