ToolLaunchpad
Converters

Markdown to HTML Converter

Write or paste Markdown on the left and see the rendered result next to it. The generated HTML is ready to copy or download as a file, and the preview is sanitized so embedded scripts never run.

Markdown to HTML ConverterRuns in your browserCtrl+Enter runs

Preview

Runs entirely in your browser. Nothing you enter is uploaded or stored.

How to use the Markdown to HTML converter

  1. Type or paste Markdown into the left box. A sample is loaded so you can see the result straight away.
  2. The preview on the right updates as you type. Below it, the HTML output box shows the exact code that was generated.
  3. Press Copy HTML to paste the code into a CMS, an email template or a static page, or Download .html to save a complete document with a UTF-8 charset and a title taken from your first heading.
  4. Tick Line breaks become <br> if single line breaks should stay visible, as in GitHub comments.

The conversion happens on your device. Images are not loaded in the preview unless you tick Load images in preview, because fetching them would contact the server that hosts them.

Worked example

This Markdown uses a task list, inline formatting and a table with a right-aligned column:

## Tasks

- [x] Write **docs**
- [ ] Ship `v2`

| Name | Qty |
| --- | ---: |
| Apples | 3 |

It becomes this HTML:

<h2>Tasks</h2>
<ul>
<li><input checked="" disabled="" type="checkbox"> Write <strong>docs</strong></li>
<li><input disabled="" type="checkbox"> Ship <code>v2</code></li>
</ul>
<table>
<thead>
<tr>
<th>Name</th>
<th align="right">Qty</th>
</tr>
</thead>
<tbody><tr>
<td>Apples</td>
<td align="right">3</td>
</tr>
</tbody></table>

How it works and why sanitizing matters

Parsing uses marked with GitHub Flavored Markdown enabled, so you get tables, task lists, strikethrough with ~~text~~, fenced code blocks and automatic links. Markdown allows raw HTML, which means a document can contain <script> tags or attributes like onerror. Before anything is shown, the generated HTML passes through DOMPurify, which removes scripts, event handlers, javascript: links, inline styles and embedded frames. The preview therefore cannot run code, even if you paste Markdown from an untrusted source.

With Sanitize HTML output ticked, the code in the output box is cleaned the same way. Untick it only if you trust the source and need raw HTML such as custom attributes. If you need to escape HTML so it shows as text, use the HTML entity encoder; to get plain text back out of HTML, try strip HTML tags.

Common mistakes

  • Missing blank lines – a list or table directly after a paragraph line may not be recognised. Leave an empty line before it.
  • Table without a separator row – GFM tables need the | --- | line under the header, with one cell per column.
  • Indented text turning into code – four leading spaces start a code block. Remove the indentation for normal paragraphs.
  • Expecting single line breaks – standard Markdown joins lines of a paragraph. End a line with two spaces or enable the line-break option.
  • Pasting unsanitized HTML into a site – if you turn sanitizing off, check the output before publishing it.
  • Relative image paths – an image written as ![logo](img/logo.png) only works if the HTML file ends up next to that folder. Use absolute URLs when the HTML will live elsewhere.

The HTML output contains only the converted content, without a page layout or CSS. That keeps it easy to paste into an existing template, where your site's own styles decide how headings, tables and code blocks look.

Frequently asked questions

Can Markdown with scripts harm me in the preview?

No. The HTML is sanitized with DOMPurify before it is displayed, which strips script tags, event handler attributes and javascript: links, so nothing in the document can run.

Which Markdown flavour is supported?

CommonMark with GitHub Flavored Markdown extensions: tables, task lists, strikethrough, fenced code blocks and autolinks.

Is my text sent anywhere?

No. Conversion and preview run in your browser. Remote images are not even loaded unless you enable the option.

Why are my images shown as placeholders?

Loading an image would contact the server that hosts it, so the preview shows the alt text instead. Tick Load images in preview to display them. The HTML output always keeps the image tags.

Does the downloaded HTML include CSS?

It is a minimal, valid HTML document with a UTF-8 charset and a title, but no styling, so you can add your own stylesheet.

Can I convert HTML back to Markdown?

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

More free Launchpad tools