Markdown Formatter and Beautifier
TX-45Paste Markdown to tidy it: consistent list markers, aligned tables and clean spacing. You can also rewrap paragraphs at a line width or join them into single lines.
Runs in your browser. Nothing is uploaded.
Markdown
Formatted Markdown
How to use it
- Paste your Markdown into the input box, or open a .md file.
- Choose how to wrap text: keep line breaks, wrap at a width, or join lines.
- Pick the list indent, 2 or 4 spaces.
- Copy the formatted Markdown or download it as a .md file.
What gets tidied
The formatter is Prettier's Markdown printer. Bullet markers become dashes, nested lists are indented by the width you choose, and table columns are padded so the pipes line up. Emphasis is written with underscores and bold with two asterisks. Runs of blank lines are reduced to one, and trailing spaces are removed. Heading style stays as you wrote it, hash or underlined.
Wrapping
By default line breaks are kept, so the diff of your document stays small. Wrap at the line width reflows paragraphs to 80, 100 or 120 columns, and Join into one line puts each paragraph on a single line, which suits editors that soft wrap. Code blocks, tables and headings are never wrapped. The rendered result is the same, because Markdown treats a single line break inside a paragraph as a space.
What stays as it is
Code blocks are copied exactly, with no formatting of the code inside, and raw HTML is kept as written. Front matter at the top is kept. Because Markdown parsers differ on a few edge cases, such as lists indented with tabs, check the rendered result where it matters. The formatter does not fix broken links or spelling, and it does not render anything.
Questions people ask
How do I format Markdown online?
Paste the Markdown and the tidied version appears as you type. Lists, tables and spacing are made consistent. Copy it or download it as a .md file. Nothing is uploaded, so private notes and READMEs are fine to paste.
Does it change how my Markdown renders?
In standard Markdown it should render the same. Only formatting such as list markers, spacing and table padding changes. A few parsers read edge cases differently, such as tab-indented nested lists, so check the rendered page where it matters.
Can it align Markdown tables?
Yes. Each column is padded to the width of its longest cell and the separator row is lengthened to match, so the pipes line up in plain text. Column alignment markers such as :--- and ---: are kept.
What does the wrap option do?
Keep line breaks leaves paragraphs as you wrote them. Wrap at the line width reflows them to 80, 100 or 120 columns. Join into one line puts each paragraph on one line. Code blocks, tables and headings are not wrapped in any mode.
Does it format code inside code blocks?
No. Code blocks are copied exactly as written, including their language label. If you want the code formatted, format it with the matching tool on this site first and paste it back into the block.
Why did my asterisks change to underscores?
The formatter writes emphasis with underscores, so *text* becomes _text_. Bold stays as two asterisks. Both forms render identically in standard Markdown, so the page you publish looks the same; only the source text changes.
About this tool
Uses the Prettier Markdown formatter. It makes list markers consistent (dashes for bullets), aligns table columns, writes emphasis with underscores and bold with two asterisks, and normalizes blank lines and spacing. Headings keep the style you wrote, # or underlined. Wrapping is off by default; choose a width to rewrap paragraphs, or join them into single lines. Code blocks are left exactly as written, not formatted, and raw HTML is kept as it is. The result renders the same as the input in standard Markdown, but a few parsers differ on edge cases such as nested lists indented with tabs, so check the preview where it matters. Front matter is kept.