Home › Developer Tools › Markdown Formatter

Markdown Formatter

Paste messy Markdown and get clean, consistent output from Prettier: normalized headings, lists and emphasis, aligned tables and optional line wrapping. Check the result in the live preview, then copy or download it.

Last updated:

Loading the Prettier formatter…

Tip: press Ctrl + Enter to format. Formatting uses Prettier and runs entirely in your browser; your text is never uploaded.

Advertisement
Advertisement

How to use the Markdown Formatter

  1. Paste your Markdown into the input, open a .md file, or load the messy sample.
  2. Choose the style: prose wrap and print width, bullet marker, aligned or compact tables, and whether to format code blocks.
  3. Press Format Markdown (or Ctrl + Enter). With Format as I type on, the output updates while you edit.
  4. Switch to Preview to see the rendered result and check that nothing changed meaning.
  5. Copy or download the formatted Markdown, or press Use output as input to keep editing.

Before and after: what the formatter normalizes

InputFormattedWhy
Title
=====
# TitleATX headings are easier to scan and edit than underlined (Setext) headings.
### Notes ###### NotesClosing hashes are optional and removed.
* item / + item- itemOne bullet marker throughout (configurable).
*emphasis*, __bold___emphasis_, **bold**Consistent emphasis delimiters.
***---Consistent thematic break.
Three blank linesOne blank lineExtra blank lines have no effect when rendered.
|a|b|
|-|-|
| a | b |
| --- | --- |
Aligned table columns are readable in plain text.

Prose wrap: which option to choose

  • Preserve (Prettier's default) keeps your existing line breaks inside paragraphs. Choose it when you don't want any reflowing.
  • Wrap at print width reflows paragraphs to 80 characters (or the width you pick). Good for documents read in terminals and for email-style plain text.
  • One line per paragraph removes hard line breaks. Many teams prefer it for READMEs and docs sites, because editing a sentence then changes only one line, and editors soft-wrap the text anyway.

Markdown also has hard line breaks: a line ending in two spaces or a backslash forces a <br>. The formatter keeps both forms exactly as written, so the rendered output stays identical. Because trailing spaces are invisible, a backslash is the safer choice for new documents.

Need to build a table first? Use the Markdown Table Generator, or write and preview documents in the Markdown Editor.

Frequently asked questions

What does the Markdown formatter change?

It reprints the document in a consistent style: # headings instead of underlined ones, - for bullet lists (or your chosen marker), _ for emphasis and ** for bold, one blank line between blocks, escaped special characters where needed, re-indented nested lists and aligned table columns. The rendered meaning of the document stays the same.

Will it rewrap my paragraphs?

Only if you ask. Preserve keeps your line breaks, Wrap at print width rewraps paragraphs to the chosen width, and One line per paragraph joins each paragraph into a single line, which works well with git diffs in some workflows and with editors that soft-wrap.

Is the output the same as running Prettier?

Yes for the core formatting, since the tool runs Prettier 3's Markdown printer with the options shown. Two options are extra: the list marker choice and compact tables are applied after Prettier, because Prettier always uses - and aligned tables.

Does it support GitHub Flavored Markdown?

Yes. Tables, task lists (- [ ] and - [x]), strikethrough, autolinks and fenced code blocks are understood and preserved. YAML front matter at the top of the file is kept as is.

Why are my numbered lists renumbered?

Prettier follows your first two items: if the list starts 1. 2. it numbers incrementally, and if it starts 1. 1. it uses 1. for every item, which keeps diffs small when items are inserted. Markdown renderers number the items correctly either way.

Is my text uploaded?

No. Prettier, the Markdown parser and the preview renderer are JavaScript files that run in your browser tab. Your text never leaves the device.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Markdown EditorWrite Markdown with a toolbar, live split preview, autosave and .md or HTML export.Markdown Table GeneratorBuild Markdown tables in a grid or paste from Excel/CSV, with alignment and preview.Markdown to HTMLConvert Markdown to clean HTML with a live editor.TypeScript FormatterFormat TypeScript and TSX code with Prettier: width, tabs, semicolons and quotes options.Changelog GeneratorTurn Conventional Commit messages into a grouped Keep a Changelog Markdown file per version.JSON FormatterBeautify, minify and validate JSON, with a collapsible tree view.SQL Formatter & BeautifierFormat, beautify or minify SQL queries for MySQL, PostgreSQL and more.JavaScript BeautifierFormat and beautify messy or minified JavaScript, or minify it.HTML FormatterBeautify and indent HTML code with a live preview.CSS FormatterBeautify CSS with indent controls and optional property sorting.XML FormatterBeautify, validate and minify XML with a collapsible tree view.ZIP File CreatorCompress files and folders into a ZIP.YAML Validator & FormatterValidate, format and minify YAML, and convert YAML to JSON or back.HTML MinifierMinify HTML: strip comments and whitespace safely and see how many bytes you save.CSS MinifierMinify CSS with csso or a built-in engine and see the size saved instantly.JavaScript MinifierMinify JavaScript with Terser: compress, mangle and see how many bytes you save.JSON MinifierMinify and validate JSON, sort keys and see exactly how many bytes you save.Code Diff CheckerCompare two code files side by side or unified, with syntax colors and changes highlighted.IPv6 Expander & CompressorExpand IPv6 addresses to full form or compress them per RFC 5952, one or many at once.GraphQL FormatterPretty-print and indent GraphQL queries, mutations and schemas, or minify them, instantly.CSS ValidatorValidate CSS: syntax errors, unknown properties and invalid values by line, plus auto-fix.Gzip Compress / DecompressGzip or deflate text and files, get Base64 output, and decompress Base64 or .gz files.IBAN ValidatorCheck an IBAN's mod-97 checksum, country and length, and see its bank code and account parts.JavaScript Syntax CheckerCheck JavaScript for syntax errors with line and column, for any ES version, script or module.JSON Schema ValidatorValidate JSON against a JSON Schema (draft-07, 2019-09, 2020-12) with clickable error paths.PHP FormatterBeautify PHP code with Prettier PHP: PSR-12 style, indent and brace options, syntax errors.XML MinifierMinify and validate XML: strip whitespace and comments, keep CDATA, see the size savings.C# FormatterBeautify C# code online: Allman or K&R braces, indent size and line width, clang-format option.HTML ValidatorCheck HTML for errors and warnings with line numbers, locally or with the W3C Nu checker.Java FormatterBeautify Java code online: indent size, brace style and line width, with clang-format option.JavaScript ObfuscatorObfuscate JavaScript with string encoding, renaming and control-flow flattening presets.Phone Number FormatterFormat and validate lists of phone numbers to E.164, international or national style.Python FormatterFormat Python code in Black/Ruff style: line length, quote style, indent, copy or download.Responsive Design CheckerPreview any website at phone, tablet, laptop and desktop sizes side by side, with rotate and zoom.Browser Compatibility CheckerSearch CSS, JavaScript and HTML features and see which browser versions support them.Core Web Vitals CheckerCheck real-user LCP, INP and CLS for any URL or site and see if it passes Core Web Vitals.Heading Structure CheckerPaste HTML to see its H1-H6 outline and catch missing H1s, multiple H1s and skipped levels.Website Hosting CheckerFind out who hosts a website: hosting provider, IP addresses, ASN, network owner and location.Luhn Algorithm CheckerValidate numbers with the Luhn mod 10 check or calculate the missing check digit, step by step.XSD ValidatorValidate XML against an XSD schema in your browser and see each error with its line number.Strftime Format BuilderBuild Python and C strftime format strings by clicking tokens, with a live preview and reference.Routing Number ValidatorCheck a US ABA routing number's checksum and format and see its Federal Reserve district.Spam Word CheckerScan an email subject and body for spam trigger words, excess caps, exclamation marks and risky links.Check Digit CalculatorCalculate or validate check digits for UPC, EAN, GTIN, SSCC, ISBN, ISSN and mod 11 codes.
See all 41 Code Formatters & Validators →