{jsonbody.com}

Markdown to HTML

Convert Markdown to clean HTML with a live preview. Supports GitHub-style tables, task lists and code blocks. Copy the HTML or download a file for free.

Convert Markdown to HTML

Markdown is a lightweight way of writing formatted text with plain characters, used in README files, documentation, blogs and comment boxes. This tool converts it to HTML as you type and shows a live preview beneath the output. Copy the result into a CMS or an email template, or download it as an HTML file.

GitHub Flavored Markdown is on by default, which adds tables, task lists, strikethrough and fenced code blocks to the original syntax. Turn on the line break option if you want each new line to become a <br>, as in chat apps and comments.

Example

A short mix of common syntax and the HTML it produces.

Markdown input and HTML output
## Release notes

Some **bold** text and a [link](https://example.com).

- First item

<h2>Release notes</h2>
<p>Some <strong>bold</strong> text and a <a href="https://example.com">link</a>.</p>
<ul>
<li>First item</li>
</ul>

Markdown syntax cheat sheet

  • # Heading to ###### Heading create headings from level 1 to level 6.
  • **bold**, *italic* and ~~deleted~~ style text.
  • [text](url) makes a link, and ![alt](image.png) adds an image.
  • - starts a bullet, 1. a numbered list, and - [x] a task list item.
  • > starts a quote, and three backticks fence a code block.
  • Pipes and dashes such as | a | b | build tables.

Sanitize HTML before publishing it

Markdown allows raw HTML, so a <script> tag or a malicious link written in the source passes through into the converted output. The live preview on this page is cleaned with DOMPurify before display, so it is safe to view. The HTML in the output box, however, is not sanitized, because you may want to keep your own markup. If your application accepts Markdown from users, always clean the HTML on your server before storing or displaying it, otherwise you open the door to cross-site scripting attacks.

Styling the result

The output contains plain tags without any classes or styles, so it picks up the look of the site where you paste it. On a blank page, it will appear with basic browser defaults. For code blocks, language names are kept as a class, such as language-js, which syntax highlighters like Prism and highlight.js can use. Search engines read the headings too, so use a logical order and only one level 1 heading on a page.

Frequently Asked Questions

Why don't my line breaks show up?

In standard Markdown, a single newline is treated as a space. Leave a blank line for a new paragraph, or turn on the line break option.

Why does my table not render?

Tables need GitHub Flavored Markdown to be on and a separator row of dashes under the header. Also make sure there is a blank line before the table.

Can I convert HTML back to Markdown?

Not with this tool. It only converts in one direction, from Markdown to HTML.

Are different Markdown flavours compatible?

The basics are the same, but extras differ. GitHub, Reddit and various other platforms each add their own features, so advanced syntax may not transfer.