What the Markdown Formatter does
The Markdown Formatter formats Markdown with Prettier 3.3.3, an open-source code formatter, running in your browser. It supports CommonMark and GitHub-style Markdown: headings, lists, tables and code fences.
Markdown Formatter examples
The built-in sample
Input
# Title
* one
* twoOutput
# Title
- one
- two
This is the input that the Load sample button fills in.
Headings, emphasis, tables and code
Input
Setext
======
__bold__ and *em*
| a | b |
|---|---|
| 1 | 22222 |
```js
const a={b:1}
```Output
# Setext
**bold** and _em_
| a | b |
| --- | ----- |
| 1 | 22222 |
```js
const a = { b: 1 };
```
The underlined heading becomes a # heading, __bold__ becomes **bold** and *em* becomes _em_. Table columns are padded to line up. The code inside the fence is not touched.
Each output was produced by running this tool on the input above it.
How it works
The code is parsed with Prettier's markdown parser and printed again from its syntax tree, using Prettier's default options: lines up to 80 characters and two-space indentation. The result therefore does not depend on how the input was laid out. If the code cannot be parsed, the parser's message with its line and column is shown instead of output.
Details and limits
- Bullet markers become
-, and when two lists follow each other directly the marker alternates so they stay separate lists. - Paragraph text is not re-wrapped: line breaks inside a paragraph stay where you put them.
- Numbered lists keep your numbering style. A list written as
1. 1. 1.is left that way. - YAML front matter between
---lines at the top of the file is kept as it is.
Common errors
| Message or symptom | What it means |
|---|---|
| Formatting changes list markers | Prettier normalises bullet markers and spacing. This is expected and does not change the rendered result. |
Worked example: Tidying inconsistent list markers and misaligned pipe tables
Suppose you paste a rough Markdown draft that mixes * and + list bullets, lacks blank lines around headings, and has uneven table columns:
##Release Checklist
* Run unit suite
+Check bundle size
|Step|Owner|Status|
|---|---|---|
|Database migration|Priya|Done|
Running the Markdown Formatter inserts the required space after ##, standardizes unordered list markers to -, adds blank lines between block elements, and pads the table pipes:
## Release Checklist
- Run unit suite
- Check bundle size
| Step | Owner | Status |
| ------------------ | ----- | ------ |
| Database migration | Priya | Done |Limits and what this tool cannot do
- Formats syntax, does not check spelling or grammar: The formatter normalizes Markdown punctuation, spacing, and indentation; it does not rewrite prose or fix broken English.
- Does not modify code inside fenced code blocks (
``</code>):</strong> Any code inside a fenced block is kept verbatim unless a supported language parser handles it.</li> <li><strong>MDX and custom JSX tags:</strong> If your Markdown contains React/MDX component tags (`), use the MDX Formatter so JSX expressions are parsed properly.
Questions
Will the rendered page look different?
No. The changes are to the source only: marker characters, spacing and table alignment. The HTML that a Markdown renderer produces from it is the same.
Why did the formatter change my * bullets to - bullets?
Standardizing unordered list markers to - (at the top level) prevents mixed *, +, and - bullets from creating separate <ul> lists in strict CommonMark parsers.
Does formatting change how the rendered HTML looks?
No—except when fixing missing spaces after # headings (#Heading -> # Heading), where fixing the syntax allows the heading to render properly instead of appearing as a literal # hashtag.
How are numbered lists (1., 1., 1.) handled?
Ordered list items are normalized sequentially (1., 2., 3.) with consistent indentation for nested sub-lists.