Markdown to HTML

Paste Markdown and get its HTML source, either as a snippet for an existing page or as a complete .html file.

How it works

The Markdown is converted in your browser by marked, which follows CommonMark and adds GitHub tables, task lists, strikethrough and fenced code. Headings get id attributes that match GitHub's anchors.

The HTML is then cleaned with DOMPurify. Raw HTML you wrote in the Markdown stays, but <script> tags, event handlers such as onclick, and javascript: links are removed, so the result is safe to paste into a page.

For a web page of its own, the snippet is wrapped in a doctype, a UTF-8 charset, a mobile viewport tag and a <title> taken from your first # heading.

How to use it

  1. 1 Paste or type your Markdown.
  2. 2 Choose what the HTML is for: pasting into an existing page, or a web page of its own.
  3. 3 Copy the HTML, or download it as an .html file.

Good to know

  • Most CMS editors have an HTML or code view. Paste the snippet there, not into the visual editor, or the tags appear as text.
  • The snippet has no styling. It picks up whatever styles the page you paste it into already has.
  • A heading such as "## Getting started" becomes <h2 id="getting-started">, so you can link to #getting-started from anywhere on the page.
  • Code blocks keep their language as a class, such as class="language-js", which syntax highlighters look for.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Moving a Markdown post into a CMS that only takes HTML

Many people draft in Markdown because it is quick to type and easy to read as plain text. The trouble starts when the draft has to go into a content management system, a newsletter tool or a help centre that wants HTML. Retyping the formatting by hand is slow and error-prone. Converting it takes a few seconds.

Here is a short release note as an example. It starts with "# Version 2.4", then the sentence "This release is about **speed**.", then "## What changed" and a list of two items: "- Exports are 3 times faster" and "- New [setup guide](https://example.com/setup)". Converted with Pasting into a page or CMS chosen, it becomes a few lines of HTML. The title is <h1 id="version-24">Version 2.4</h1>. Note the id: the full stop is dropped, as GitHub does. The sentence becomes a <p> with <strong>speed</strong> inside it, and the list becomes a <ul> with two <li> items, the second holding an <a href> link.

Paste that into the HTML view of your CMS and the post appears with its headings, bold text and link intact, in your site's own fonts. If the CMS strips id attributes, nothing breaks; only links to #version-24 stop jumping to the heading. If you choose A web page of its own instead, the same lines are wrapped in a full document with <title>Version 2.4</title>, ready to open in a browser or attach to an email.

One thing to watch is raw HTML. Markdown lets you mix tags in, so a line such as <details><summary>More</summary>Hidden text</details> passes straight through and works in most browsers. A <script> tag or an onclick attribute does not pass: the cleaning step removes them, because a converter that keeps scripts is a common way for unsafe code to reach a page.

This converter has limits. It produces plain HTML with no CSS, so tables have no borders until your site styles them. It does not convert footnotes, math, emoji shortcodes or GitHub alerts; they come out as ordinary text. Image paths are copied exactly as written, so a relative path such as images/chart.png only works if that file is in the same place on your site. And documents over one million characters are refused rather than freezing the tab.

Frequently asked questions

Which Markdown does this understand?

CommonMark, the standard most tools follow, plus the GitHub extensions: tables, task lists with [ ] and [x], ~~strikethrough~~, fenced code blocks and bare web addresses turned into links. Footnotes, math and emoji shortcodes are not converted.

Why did my <script> tag disappear?

Every result is cleaned so it is safe to paste into a page, and scripts are the main thing that cleaning removes. The same goes for onclick and onerror attributes and javascript: links. If you need a script on your page, add it in your site's template rather than in the Markdown.

Is the HTML minified or formatted?

Neither. Each block, such as a paragraph, heading or list item, starts on its own line, which is easy to read and diff. If you want it smaller, run it through an HTML minifier afterwards.

Is my Markdown uploaded?

No. The conversion runs in your browser, in a background worker, and the download is made on your device. Nothing is sent to a server.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.