What it does
The Markdown to HTML converter turns Markdown text into HTML markup that you can paste into a CMS, an email template, a static page or any place that accepts HTML but not Markdown. It is handy for publishing a README on a website, moving notes into a blog editor, or checking exactly which tags a Markdown snippet produces.
The output is the same HTML that popular Markdown renderers generate: <h1> to <h6> headings, <p> paragraphs, <ul> and <ol> lists, <pre><code> blocks with a language- class for syntax highlighters, and <table> markup for GitHub-style tables.
How to use
- Type or paste Markdown, upload an
.mdfile, or click Sample. - Choose the options you need: GitHub Flavored Markdown, line breaks as
<br>, heading IDs for anchor links, sanitizing for untrusted input, and a full HTML document instead of a fragment. - Copy the HTML or download it as an
.htmlfile.
The output updates as you type. Leave the full document option off when you paste the result into an existing page, and turn it on when you want a standalone file.
Example
This Markdown:
## Install
Run the **installer** and read the [guide](https://example.com).
- Windows
- macOS
becomes this HTML:
<h2>Install</h2>
<p>Run the <strong>installer</strong> and read the <a href="https://example.com">guide</a>.</p>
<ul>
<li>Windows</li>
<li>macOS</li>
</ul>
Tips
- Raw HTML inside Markdown is kept as it is by default, which is what most renderers do. Turn on sanitizing whenever the Markdown was written by someone else.
- With heading IDs on, you can link to a section with an address such as
page.html#install, and build a table of contents from the headings. - Code blocks keep their language as a class, so highlighters like Prism or highlight.js pick them up without extra work.
- To preview the rendered result side by side, use the Markdown previewer. To go the other way, use the HTML to Markdown converter.
FAQ
› Which Markdown syntax is supported?
Everything in CommonMark, such as headings, emphasis, links, images, lists, blockquotes, code and horizontal rules. With GitHub Flavored Markdown turned on you also get tables with column alignment, task lists, strikethrough and automatic links for bare URLs.
› What does the sanitize option do?
It escapes any raw HTML in the Markdown so it shows up as text instead of becoming tags, and it removes links and images whose URL uses an unsafe scheme such as javascript or vbscript. Turn it on when the Markdown comes from users you do not trust, for example comments or forum posts.
› How are heading IDs generated?
The same way GitHub does it. The heading text is lowercased, punctuation is removed and spaces become hyphens, so "Getting Started" gets the id getting-started. Repeated headings get -1, -2 and so on, which keeps every anchor unique.
› What is the full HTML document option for?
It wraps the result in a complete page with a doctype, UTF-8 charset, a viewport tag, a title taken from the first level-one heading and a small readable stylesheet. Save it as an .html file and it opens nicely in any browser.
› Is my Markdown sent anywhere?
No. The conversion runs in your browser with the marked library, and nothing is uploaded to a server.