Skip to content

Markdown to HTML Converter

Convert Markdown into clean HTML source code you can paste into any page.

Markdown

Tab inserts indentation. Press Escape, then Tab, to move focus out of the editor.

HTML

Output view

How to convert Markdown to HTML

  1. Paste Markdown on the left, or open a .md file.
  2. The HTML source code appears on the right. Switch to Preview to see how it renders.
  3. Choose an HTML fragment for an existing page or a full HTML document for a standalone file.
  4. Copy the HTML or download it as an .html file.

Example: Markdown and the HTML it produces

Markdown
## Browser support

- Chrome **110**
- [Changelog](https://example.com)

| Browser | Version |
| ------- | ------: |
| Safari  | 16.4    |
HTML
<h2>Browser support</h2>
<ul>
<li>Chrome <strong>110</strong></li>
<li><a href="https://example.com" rel="nofollow noopener noreferrer">Changelog</a></li>
</ul>
<table>
<thead>
<tr>
<th>Browser</th>
<th align="right">Version</th>
</tr>
</thead>
<tbody><tr>
<td>Safari</td>
<td align="right">16.4</td>
</tr>
</tbody></table>

Links to other sites get rel="nofollow noopener noreferrer", table column alignment becomes an align attribute, and code blocks keep their language as a language-… class, which syntax highlighters such as Prism or highlight.js recognise.

Rendered preview vs. HTML source

The Code view is the HTML source you copy into a template, CMS or email. The Preview view shows what a browser makes of it. The preview runs in a locked-down frame without scripts, so even HTML you chose to keep can't affect this page.

Features

  • CommonMark and GitHub Flavored Markdown (tables, task lists, strikethrough, autolinks).
  • HTML fragment or complete document with a title and basic styles.
  • Three modes for raw HTML: allow safe tags, show as text or keep as written.
  • Unsafe links such as javascript: are always removed.
  • Deterministic output: the same input always gives the same HTML.

Related tools

Write and preview Markdown first in the Markdown editor, or read finished files in the Markdown reader. Re-indent the generated HTML with the HTML formatter, open it in the HTML viewer, or keep working on it in the online HTML editor.

Frequently asked questions

Fragment or full HTML document — which do I need?
Choose a fragment to paste into an existing page, template or CMS. Choose a full document to get a standalone .html file with a <head>, a title taken from the first heading and simple readable styles.
What does the GitHub Flavored Markdown option change?
With it on, tables, task lists, ~~strikethrough~~ and bare URLs become HTML the way GitHub renders them. With it off, only standard CommonMark is converted and those stay as plain text.
What happens to HTML inside my Markdown?
By default, safe tags are kept and anything that could run code (scripts, event handlers, javascript: links) is removed. You can also show raw HTML as text, or keep it exactly as written if you trust the source.
Is the output the same every time?
Yes. The same Markdown and options always produce exactly the same HTML, so the output is safe to commit or compare in a diff.