Code Tools

Markdown Formatter

All tools

Clean up line endings and stray whitespace in Markdown without changing a word of the content.

How it works

Four simple steps

1

Paste Markdown

Add a README, changelog or docs page to the input.

2

Line endings unified

CRLF becomes LF and trailing spaces are removed.

3

Blank lines collapsed

Three or more line breaks shrink to a single blank line.

4

Copy or save

Copy the cleaned text or download formatted.md.

Markdown Formatter

About Markdown Formatter

A README has been edited on Windows and macOS, pasted from a chat thread and touched by three contributors. The pull request diff is full of whitespace noise. Running the file through a quick normalizer gives everyone a clean baseline.

The Markdown formatter makes four changes and nothing else. Windows CRLF line endings become LF, trailing spaces and tabs at the ends of lines are removed, runs of three or more line breaks shrink to a single blank line, and the file ends with one newline. Headings, list markers, emphasis, links and code are left exactly as written; it does not renumber lists or reflow paragraphs. Output appears as you type and downloads as formatted.md.

The classic mistake: Markdown treats two trailing spaces as a hard line break, and this tool removes them. If you rely on that, end the line with a backslash instead, which survives the cleanup. Blank-line collapsing also applies inside fenced code blocks. Check the rendered result in the Markdown Preview, and if you are adding tabular data, the Markdown table generator produces aligned pipes. To confirm that only whitespace changed, compare old and new in the text diff tool.

Your draft is cleaned with a handful of string replacements in this page and is never stored or uploaded.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

No. List markers, numbering and indentation are untouched. The tool only handles line endings, trailing whitespace and blank lines.

They are treated like any other text, so three or more empty lines in a fenced block become one. If exact spacing inside a code sample matters, check that block after formatting.

Only trailing spaces at the end of table rows are removed. Pipes, alignment colons and padding inside each row stay as they were.

View more FAQs

Related tools

View all

HTML Formatter

Beautify and indent HTML markup.

Open

CSS Formatter

Format and pretty-print CSS.

Open

JS Formatter

Beautify JavaScript code.

Open

JSON Formatter

Beautify and validate JSON.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools