Markdown to HTML Converter

In Markdown, "# Hello" becomes <h1>Hello</h1>, "**bold**" becomes <strong>bold</strong> and "[text](https://example.com)" becomes <a href="https://example.com">text</a>.

Preview

Did this solve your problem?
Prefer us on Google

How to use

  1. Type or paste Markdown into the input box. A sample is loaded so you can see the result right away.
  2. Switch between Preview, which shows the rendered page, and HTML, which shows the source code.
  3. Press Copy HTML to copy the source. The result updates as you type.
  4. Leave Allow raw HTML off for untrusted text. Turn it on only if your Markdown contains HTML tags you want to keep in the output. The preview stays sanitized either way.

How it works

The converter reads Markdown in two passes, following the CommonMark rules for the parts it supports. First it splits the text into blocks: headings, paragraphs, lists, block quotes, code blocks and horizontal rules. Then it reads the inline text inside each block for emphasis, code, links and images.

Supported: # headings and underlined headings, paragraphs and line breaks, *italic* and **bold**, `inline code`, fenced and indented code blocks, > quotes, bullet and numbered lists with nesting, [links](url "title"), ![images](url), automatic <https://links>, reference links and --- rules. Not supported: tables, footnotes, task lists and strikethrough, which come from GitHub-style extensions rather than CommonMark.

Safety comes in two layers. By default, any HTML typed in the Markdown is escaped, so <script> shows up as text. Link and image addresses are checked, and only http, https, mailto and tel links (http and https for images) are allowed, so javascript: and data: addresses are dropped. Before the preview is drawn, the HTML goes through a second allowlist filter that keeps known tags and attributes and removes everything else, including all on* event handlers and style attributes.

Links in the preview open in a new tab with rel="noopener noreferrer nofollow". The HTML you copy is the converter output without those extras.

Markdown syntax cheat sheet

You typeYou getHTML
# HeadingHeading 1<h1>
**bold**bold<strong>
*italic*italic<em>
`code`code<code>
- itemBullet list<ul><li>
1. itemNumbered list<ol><li>
> quoteBlock quote<blockquote>
[text](url)Link<a href>
![alt](url)Image<img>
---Horizontal rule<hr />

FAQ

Is it safe to preview untrusted Markdown?

Yes. HTML in the text is escaped by default, dangerous link schemes are removed, and the preview is filtered again before it is shown. Scripts and event handlers cannot run. Images you link to are still loaded from their own servers.

Why does my HTML tag show up as text?

Allow raw HTML is off, so tags are escaped on purpose. Turn it on to pass tags through to the HTML output. The preview still removes anything unsafe, such as script tags.

Does it support tables and task lists?

No. Tables, task lists, footnotes and strikethrough are GitHub Flavored Markdown additions. This tool covers the core CommonMark features.

How do I add a line break inside a paragraph?

End the line with two spaces or a backslash. A single line break is treated as a space, as in CommonMark.

How do I show a literal asterisk or underscore?

Put a backslash before it, such as \* or \_. Inside inline code or a code block, no escaping is needed.

Is my text uploaded?

No. Conversion and preview happen in your browser.