Skip to main content
CalcChef

Markdown to HTML

Convert Markdown to HTML with GitHub tables, task lists and strikethrough. Raw HTML shows as text except 17 plain tags; javascript: links become text. How it works

Use the Markdown to HTML

39 of 100,000 characters.

Hello World

Type some markdown here.

7 words39 chars32 (no spaces)2 paragraphs~1 min read

Rendered preview from markdown. Remote images are loaded from their own servers.

About the Markdown to HTML

In this Markdown to HTML converter, # Hello World becomes <h1>Hello World</h1>, **bold** becomes <strong>bold</strong> and a pipe table becomes a <table>. It uses the marked library with GitHub Flavored Markdown on, and it does not pass raw HTML through: a tag such as <span style="..."> or <script> comes out as visible text, except 17 tags without attributes such as <kbd> and <details>. Links keep only http, https, mailto, tel and relative addresses.

Markdown syntax and the HTML it becomes

MarkdownHTML output
# Title<h1>Title</h1>
## Subtitle<h2>Subtitle</h2>
**bold**<p><strong>bold</strong></p>
*italic*<p><em>italic</em></p>
~~deleted~~<p><del>deleted</del></p>
`code`<p><code>code</code></p>
[link](https://example.com)<p><a href="https://example.com">link</a></p>
![alt text](https://example.com/a.png)<p><img src="https://example.com/a.png" alt="alt text"></p>
- one ⏎ - two<ul><li>one</li><li>two</li></ul>
1. one ⏎ 2. two<ol><li>one</li><li>two</li></ol>
> quote<blockquote><p>quote</p></blockquote>
```js ⏎ let a = 1; ⏎ ```<pre><code class="language-js">let a = 1;</code></pre>
- [x] done ⏎ - [ ] to do<ul><li><input checked="" disabled="" type="checkbox"> done</li><li><input disabled="" type="checkbox"> to do</li></ul>
| a | b | ⏎ |---|--:| ⏎ | 1 | 2 |<table><thead><tr><th>a</th><th align="right">b</th></tr></thead><tbody><tr><td>1</td><td align="right">2</td></tr></tbody></table>
line one ⏎ line two<p>line one<br>line two</p>
---<hr>
Visit https://example.com<p>Visit <a href="https://example.com">https://example.com</a></p>

⏎ marks a new line in the Markdown; the line breaks between tags in the output are left out here. GFM and Line breaks are on, as they are by default.

What the converter does not pass through

MarkdownHTML outputTags written as textAddresses dropped
<kbd>Ctrl</kbd><p><kbd>Ctrl</kbd></p>00
<span style="color:red">red</span><p>&lt;span style=&quot;color:red&quot;&gt;red&lt;/span&gt;</p>20
<script>alert(1)</script>&lt;script&gt;alert(1)&lt;/script&gt;20
[click](javascript:alert(1))<p>click</p>01
![x](data:image/png;base64,AAAA)<p>x</p>01
[mail me](mailto:[email protected])<p><a href="mailto:[email protected]">mail me</a></p>00
Text[^1] ⏎ ⏎ [^1]: note<p>Text<a href="note">^1</a></p>00
:smile:<p>:smile:</p>00

The page counts what it wrote out as text or dropped and says so under the output. Footnote syntax is read as an ordinary reference link, and emoji shortcodes stay as text.

The allow-list

ItemAllowed
Raw HTML tags, without attributesabbr, b, br, del, details, em, i, ins, kbd, mark, s, small, strong, sub, summary, sup, u
Link addresseshttp, https, mailto, tel, relative paths and #anchors
Image addresseshttp, https and relative paths

Frequently asked questions

Does this converter follow CommonMark and GitHub Flavored Markdown?
It uses the marked library, and with GFM on it converts the GitHub extensions: tables, task lists, strikethrough and bare URLs. The current specs are CommonMark 0.31.2 and GFM 0.29-gfm; the converter does not claim to pass every example in them. One difference is a setting: with Line breaks on, the default, a single new line becomes <br>, where CommonMark makes it a soft break (a space or new line) and allows a renderer option for hard breaks. Turn Line breaks off for the CommonMark result.
Why is my HTML shown as text in the output?
Raw HTML in the Markdown is not passed through, so pasted Markdown cannot add a form, a script or a style to the page. Only 17 tags without attributes are kept, such as <kbd>, <details>, <summary>, <sub> and <sup>. <span style="color:red">red</span> comes out as text, and a note says how many tags were written out.
Does it support footnotes, emoji shortcodes or heading IDs?
No. Text[^1] with a line [^1]: note is read as an ordinary reference link, <a href="note">^1</a>; :smile: stays as text; and headings get no id attribute.
How long a document can it convert?
Up to 100,000 characters. The conversion runs in a background worker, and a document that takes longer than 2 seconds is stopped with a message; long runs of unmatched * or _ characters, or many unclosed brackets, are the usual causes.
Is my Markdown saved?
Yes, in this browser’s local storage, together with the GFM and Line breaks settings, so it is there when you come back. Clear Saved Values removes it.
What is the difference between Copy, Full page and Fragment?
Copy and Fragment give the same HTML as the Source view, with no page wrapper: Copy puts it on the clipboard and Fragment saves it as markdown-fragment.html. Full page saves markdown-output.html, a complete document with a doctype, a title and a small stylesheet, which opens in a browser on its own.

Network use

The preview loads any remote images or other media your Markdown refers to, so the server hosting them sees your IP address. Privacy policy

Related Tools

View all tools