Markdown Formatter

Normalise a Markdown file so headings, bullets, numbered lists and tables all follow one consistent style.

Markdown
Formatted Markdown
Runs locally in your browser

About the Markdown Formatter

Markdown allows several spellings of the same thing, and a document edited by more than one person ends up using all of them. This formatter parses the file and prints it again in one style: one space after every heading marker, hyphens for unordered list items, and pipe tables padded so the columns line up in the raw text as well as in the rendered page.

Ordered lists are renumbered from their first item, which is why a list that reads one, three, seven comes back as one, two, three. Two lists that sit next to each other keep different bullet characters, because that is what tells a renderer they are separate lists. Emphasis markers are normalised, extra blank lines between blocks are collapsed to one, and stray trailing spaces are removed unless they are the two that force a line break.

Prose wrapping is yours to choose. Preserve leaves each paragraph on the lines you typed and is the safest option for a repository where diffs matter. Wrap at width refills paragraphs to the line width you set, which suits documents read in a terminal. One line per paragraph joins every paragraph into a single long line, which some writing tools prefer.

Fenced code blocks are copied out exactly, including their language tag and indentation, so a code sample is never reformatted by accident. Front matter at the top of the file is left alone. To see the rendered result instead, pass the output to Markdown to HTML.

How to use

  1. Paste your Markdown into the left pane, or press Sample to load a messy README fragment.
  2. Choose a Prose wrap mode. Preserve is the right default for files kept in Git.
  3. If you picked wrap at width, set Max line width to the column your team uses, often 80 or 100.
  4. Compare the two panes, then Download the result as a .md file.

Common questions

Will it change the text of my document?
No prose is rewritten. Only the syntax characters around it change: heading markers, list bullets, table padding, emphasis characters and blank line spacing.
Why were my numbered list items renumbered?
Markdown renderers ignore the numbers after the first one, so the formatter makes the source match what readers actually see. The list still starts at whatever number you used.
Are code fences and indented code blocks safe?
Yes. Everything inside a fence is copied byte for byte, and the info string after the opening fence is preserved.
Does it support tables, footnotes and task lists?
GitHub flavoured tables and task lists are formatted properly. Footnotes and other extensions are passed through without damage even when they are not reflowed.