Markdown Formatter

Normalise Markdown headings, lists, blank lines and fences.

  • Runs locally in your browser
  • No upload required

Try it

Paste Markdown. Fenced code blocks are preserved verbatim.

Formatted Markdown
# Title - one - two
Lines
4
# Title

- one
- two

Supported formats

Input
text
Output
text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

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

  1. Track fenced code blocks so their content bypasses every normalisation step.
  2. Normalise ATX heading and list-marker spacing outside fences.
  3. Collapse blank-line runs and strip trailing whitespace.

Usage

  1. Paste or type a Markdown document.
  2. Run the formatter and copy the tidied result.
  3. 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

jsonSelect to copy
{
  "text": "#Title\n\n\n* one\n* two\n"
}

Fenced code preserved

jsonSelect to copy
{
  "text": "```js\nconst x = 1;\n```"
}

Ordered list spacing

jsonSelect to copy
{
  "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

  1. CommonMark Specification — CommonMark
  2. MDN Web Docs — Markdown — MDN