Markdown Formatter

Runs in browser Formatting

Tidy Markdown: consistent heading styles, bullet markers, numbered lists, table alignment, trailing whitespace and blank lines — with a live safe HTML preview.

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

How to use Markdown Formatter

  1. Paste Markdown text.
  2. Choose bullet marker, numbering and emphasis style.
  3. Review the preview, then copy the formatted Markdown.

Markdown Formatter features

  • Converts Setext headings to ATX and fixes "#Heading" spacing
  • Normalises bullet markers (-, * or +) and renumbers ordered lists
  • Aligns table columns and normalises alignment rows
  • Unifies bold (**) and italic (_ or *) markers outside code
  • Removes trailing whitespace (keeping hard line breaks) and extra blank lines
  • Live, sanitised HTML preview of the formatted document
  • Fenced and indented code blocks are never modified

Markdown Formatter example

Tidy a messy list and table

Input:

Title
=====
* item one
* item two

|a|b|
|-|-|
|long cell|x|

Output:

# Title

- item one
- item two

| a         | b   |
| --------- | --- |
| long cell | x   |

Frequently asked questions about Markdown Formatter

What does the formatter normalise?

Heading style (Setext → ATX with a space after #), bullet markers, ordered-list numbering, bold/italic markers, table column alignment, horizontal rules, trailing whitespace and excessive blank lines.

Are code blocks touched?

No. Fenced (``` or ~~~) and indented code blocks are copied verbatim, including trailing spaces.

Is the preview safe to use with untrusted Markdown?

Yes. Raw HTML in the source is escaped, and link/image URLs using javascript:, data: or vbscript: are neutralised.

Which Markdown flavour is used?

CommonMark with the common GitHub extensions: tables, strikethrough, task lists and autolinks.

Are hard line breaks preserved?

Yes. Lines that end with two or more spaces keep exactly two spaces so the break survives.

Technical notes

The preview renderer is a purpose-built CommonMark subset (headings, paragraphs, emphasis, code, lists, task lists, links, images, tables, block quotes, horizontal rules). Raw HTML is escaped and only http(s), mailto and relative URLs are allowed in links, so untrusted documents cannot inject scripts.