Markdown Formatter
Normalise Markdown headings, lists, blank lines and fences.
- Runs locally in your browser
- No upload required
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
Normalised the Markdown document to 4 line(s).
How it works
- Normalised ATX headings to a single space after the hashes.
- Normalised unordered list markers to '-' and ordered-list spacing.
- Collapsed runs of blank lines and removed trailing whitespace.
- Copied fenced code-block bodies byte-for-byte.
- Inline code, links and fenced content are preserved exactly.
- Formatting the output again changes nothing.
Methodology
- Track fenced code blocks so their content bypasses every normalisation step.
- Normalise ATX heading and list-marker spacing outside fences.
- Collapse blank-line runs and strip trailing whitespace.
Usage
- Paste or type a Markdown document.
- Run the formatter and copy the tidied result.
- Fenced code blocks are left exactly as written.
Examples
These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.
Heading and list normalised
{
"text": "#Title\n\n\n* one\n* two\n"
}Fenced code preserved
{
"text": "```js\nconst x = 1;\n```"
}Ordered list spacing
{
"text": "1. first\n2. second"
}Limitations
Consistent documents
A consistent heading and list style makes a README or docs page easier to scan and its diffs cleaner. Code examples are never touched.
Frequently asked questions
- Does it reflow my paragraphs?
- No. It normalises headings, list markers and blank lines; paragraph text and line wrapping are preserved.
- Is fenced code content changed?
- No. Everything inside a fence is copied byte-for-byte.
- Is my document uploaded?
- No. The document is processed entirely in your browser.
Sources
- CommonMark Specification — CommonMark
- MDN Web Docs — Markdown — MDN
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.