Markdown Formatter
Normalize headings, lists, tables, and code blocks in Markdown.
Markdown Formatter – Clean, Consistent Markdown
Markdown is forgiving: you can write headings with # or underlines, bullets with *, -, or +, and tables with any amount of spacing. That flexibility leads to inconsistent documents, especially READMEs edited by many contributors. The Markdown formatter normalizes everything with Prettier's Markdown engine.
What gets normalized
- Headings – blank lines are placed around every heading and closing
#characters are removed. - Lists – bullet markers become
-, ordered lists are numbered consistently, and nested lists are indented correctly. - Tables – columns are padded so the pipes line up, and the separator row is rebuilt.
- Emphasis –
__bold__becomes**bold**and*italic*becomes_italic_. - Code blocks – fenced code in JavaScript, CSS, YAML, JSON and other supported languages is formatted too.
- Spacing – exactly one blank line between blocks, no trailing spaces.
Prose wrapping
The Wrap prose option controls paragraphs. Keep line breaks leaves your lines as they are. Wrap at line width rewraps paragraphs to the chosen width, which is popular for documentation reviewed in diffs. One line per paragraph joins each paragraph into one long line — handy before pasting into tools that treat newlines as hard breaks.
Where this helps
Format README files before publishing a package, clean up documentation generated by other tools, prepare release notes, or standardize the docs folder of a project. Consistent Markdown renders the same on GitHub, GitLab, and static site generators.
Related tools
Writing documentation with JSX components? Use the MDX Formatter. For YAML front matter blocks on their own, the YAML Beautifier helps, and HTML embedded in Markdown can be cleaned up with the HTML Beautifier.
Frequently Asked Questions
Does the formatter change how my Markdown renders?
No. It only switches between equivalent syntaxes (for example * and - bullets) and adjusts whitespace. The rendered HTML stays the same.
Are code blocks formatted?
Fenced code blocks tagged with a language Prettier supports, such as js, ts, css, json, or yaml, are formatted. Other languages are left untouched.
Is GitHub Flavored Markdown supported?
Yes. Tables, task lists, strikethrough, and autolinks from GitHub Flavored Markdown are supported.