Markdown to HTML Converter

Markdown has no single specification, which is why the same file renders differently on GitHub, in your editor preview, and in a static site generator. This converter follows CommonMark with the GitHub Flavored Markdown extensions, which is the closest thing to a de facto standard.

How to use it

  1. Drop in a .md or .markdown file.
  2. The document is parsed and rendered to HTML in the page.
  3. Download the HTML fragment.

Which flavour this follows

The original 2004 Markdown description left a great deal undefined, including how to handle nested lists, emphasis inside words, and mismatched markup. Implementations each resolved the ambiguities differently, and the differences persist.

CommonMark exists to pin those cases down precisely, and GitHub Flavored Markdown adds the extensions people actually rely on day to day.

The GFM extensions supported here:

Raw HTML and safety

Markdown deliberately permits raw HTML, which is one of its most useful properties and its main hazard. Block-level HTML in the source passes through into the output, so an embedded iframe or a div with a class survives conversion.

That is fine for content you wrote. It is not fine for Markdown from an untrusted source, because a script tag or an onerror attribute passes through just as readily. If you are converting user-submitted content and intend to insert the result into a live page, run it through a sanitizer such as DOMPurify afterwards. Markdown conversion is not a security boundary and was never meant to be.

What you get, and what you still need

The output is an HTML fragment, not a complete document. There is no doctype, no head, and no styling, because the intent is that you drop it into an existing template or wrap it in your own layout.

Fenced code blocks are emitted with the language recorded as a class name but are not syntax-highlighted, since highlighting is a rendering concern handled by a library such as Prism or highlight.js in the destination page. Headings are not automatically given id attributes, so if you need anchor links you will want to add them in your template.

At a glance

Accepted input.md, .markdown
FlavourCommonMark plus GitHub Flavored Markdown
Raw HTMLPassed through, not sanitized
OutputHTML fragment, unstyled

Frequently asked questions

Does it support tables and fenced code blocks?

Yes, both, along with strikethrough, task lists, and automatic URL linking. Those are the GitHub Flavored Markdown extensions on top of CommonMark.

Is the HTML sanitized?

No. Raw HTML in the Markdown passes through, which is intended behaviour. Sanitize the output with a library such as DOMPurify before rendering anything that came from an untrusted source.

Why is my code not syntax-highlighted?

Highlighting is done at render time by a JavaScript library. The converter records the language as a class on the code element, which is what those libraries look for.

Do I get a complete HTML page?

No, a fragment. There is no doctype, head, or CSS, so you can drop it into your own template without stripping anything out first.

Read more

Working with documents: PDF, DOCX, and spreadsheets — Document formats encode intent as much as content, and conversions between them succeed or fail on whether that intent was recorded.

Related tools