Markdown to HTML

Convert Markdown to HTML

About Markdown to HTML

Markdown to HTML turns Markdown into a ready-to-save HTML5 file. The text is parsed by marked with GitHub Flavored Markdown on, and the result is placed inside a doctype, an html element, a head that declares UTF-8, and a body. Code blocks keep their language as a class (language-js) and characters such as < inside code are escaped. Raw HTML in your Markdown is copied through unchanged, scripts included, because nothing is sanitized here. The document has no title, styles, or lang attribute; add them if you publish it. This page shows the code, not a rendered preview.

Example

Output of the page's own conversion code for a heading, inline code, and a fenced JavaScript block.

Markdown

# Notes

Use `a < b` in **code**.

```js
if (a < b) run();
```

HTML output

<!DOCTYPE html>
<html>
<head><meta charset="utf-8"></head>
<body>
<h1>Notes</h1>
<p>Use <code>a &lt; b</code> in <strong>code</strong>.</p>
<pre><code class="language-js">if (a &lt; b) run();
</code></pre>
</body>
</html>

How to convert Markdown to an HTML file

  1. 1Paste your Markdown in the "Markdown" box.
  2. 2Click "Convert", which becomes available once the box is not empty.
  3. 3Check the code in "HTML output", then click "Copy" or use "Download" to save it as document.html.

Formats and limits

Input
Markdown text, read with CommonMark and GitHub Flavored Markdown rules
Output
One HTML document: doctype, a head declaring UTF-8 encoding, and body; no title, styles, or lang attribute
Raw HTML
Passed through as written, not sanitized
Download
document.html

Where your Markdown is converted

Conversion runs in your browser: the marked library is downloaded the first time you click Convert, and your Markdown and the resulting HTML are never sent to our servers. If an error is shown in the output box, its cleaned message is sent to our error log with the tool's name and your browser's name and version, quoted text and URLs removed, so that we can fix the problem.

Frequently asked questions

Does the output include a full HTML page?

Yes. The HTML is wrapped in a doctype, an html element, a head declaring the UTF-8 encoding, and a body, so accented letters display correctly when the file is opened. A title and styles are not added.

Is raw HTML in my Markdown kept?

Yes, exactly as written: this converter does not sanitize, so a script element or an onclick attribute in your Markdown ends up in the file. Remove anything you do not trust before publishing; Markdown Previewer shows a cleaned version.

Are code blocks syntax-highlighted?

No. A fenced block marked js becomes a pre and code element with the class language-js, ready for a highlighter such as Prism or highlight.js, but no colors are added here.

Can I convert a .md file directly?

No, there is no file upload. Open the .md file in a text editor, copy its content, and paste it in the Markdown box; the result can then be saved with the Download button.

Tips and tricks

  • ✓To read the result as a page rather than as code, paste the same Markdown into Markdown Previewer.