Skip to main content

Markdown formatter

Normalize Markdown presentation to improve readability and get a clean version ready to copy or reuse in your documents.

  • Clipboard
Automate

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

Was this tool useful?

How does this tool work?

Harmonize the syntax of a Markdown file without affecting its content: a space after each title #, standardized “-” bullets, no more than one empty line in a row and no unnecessary spaces at the end of lines. Formatting makes the source more regular, easier to reread, and produces cleaner diffs in a code repository. The processing is carried out in your browser.

The formatter reads the document line by line and applies four rules. It adds the missing space after heading markers: “#Title” becomes “# Title”, with repeated spaces after the marker reduced to one. It replaces “*” and “+” bullets with “-”, including in indented lists. Runs of blank lines are reduced to one. Unnecessary trailing spaces and tabs are removed.

Some syntax is deliberately protected. Everything inside code fences delimited by ``` or ~~~ stays unchanged, including a “#include” directive or a line starting with “*”. Horizontal rules (---, * * *, ___) remain intact. **Bold** text at the start of a line is not mistaken for a bullet, and the two trailing spaces that force a Markdown line break are preserved.

The formatter does not reorder content, renumber numbered lists or rewrite tables and links. The wording itself stays unchanged.

How to use this tool

  1. Paste Markdown

    Enter or import the document in the “Markdown Content” field.

  2. Format

    Start formatting: the rules for headings, bullets, empty lines and spaces are applied.

  3. Read the result again

    Compare with the source, then copy or export the formatted version.

Use cases

Clean a README

Standardize the titles and lists of a file written by several contributors.

Prepare a commit

Remove trailing spaces and excess empty lines before saving documentation.

Normalize exported text

Straighten a Markdown copied from another application, with disparate bullets and spacing.

Examples

Headings, bullets and blank lines

The title space is added, the bullets are standardized and the three empty lines become one.

Input

#Title
*  first point
+ second point



Final text

Result

# Title
- first point
- second point

Final text

Protected code and separator

Nothing changes: the comment is in a code block, --- is a separator and **Important** is not a bullet.

Input

```bash
#comment
```
---
**Important**: review this

Result

```bash
#comment
```
---
**Important**: review this

Tips and best practices

  • Close each block of code with ```: a block left open protects the entire rest of the document, which will then no longer be formatted.
  • A line starting with “#word” becomes the heading “# word”. If a line starts with a hashtag, add a character before it or review the result.
  • Then check the rendering with Markdown preview, especially for nested lists and tables.

Sources and references

Frequently asked questions

What exactly does the formatter change?

Four things: the space after the # of titles, the bullets “*” and “+” replaced by “-”, successive empty lines reduced to one and end-of-line spaces removed.

Are my code blocks modified?

No. Everything between two delimiters ``` or ~~~ is preserved character by character, including empty lines.

Are forced line breaks preserved?

Yes. Two or more spaces after text, which force a newline in Markdown, are reduced to exactly two spaces instead of being removed.

Are numbered lists renumbered?

No. The numbers are left as written; only the unnumbered bullets are standardized.

Can I use it in a Pipeline?

Yes. Formatting can be carried out with other word processors, for example before converting Markdown to HTML.

Related tools

Tools similar or complementary to this one.

Similar tools

Generate Lorem Ipsum placeholder text for mockups, prototypes and layout tests.

Text & writingFeaturedUse this tool

Write Markdown and instantly preview the rendered HTML.

Text & writingUse this tool