Format Markdown

Normalize Markdown spacing, headings, lists, and fences while preserving the document’s words.

freeworks offlinenothing uploaded
ToolMarkdown Formatter
Input
Output

How it works

Blocks are scanned to normalize blank lines, heading spacing, list indentation, and fenced-code boundaries while preserving content lines. The formatter is line-oriented and does not rewrite prose or render HTML.

  • Consistent spacing improves source readability.
  • Fenced code is preserved because its contents may be executable.

Worked example

Format messy markdown
Add proper spacing around headings and blocks
Input
											# Title
Some text
## Section
More text
										
Output
												Formatted: # Title

Some text

## Section

More text

											

When to use this

README cleanup, static-site content, and pre-commit documentation checks format Markdown.

Edge cases

  • A heading-like line inside a fence remains code.
  • Four-space indentation can be a code block and should not become a list.
  • Two trailing spaces can encode a hard line break.

References