06 / Markdown / markdown-html

Markdown → HTML

Convert Markdown to sanitized HTML.

ReadyLocal processing
06 · Workspace

How to use

  1. 01Paste your Markdown into the Markdown input on the left.
  2. 02Read the generated HTML in the Output panel. It updates as you type.
  3. 03Switch the Output view between Raw HTML (the markup) and Rendered (how it will look).
  4. 04Click Copy HTML to copy the HTML fragment, ready to paste into a template or CMS.
  5. 05Or click Download .html to save a complete, standalone document.html file.

What is this tool?

The Markdown to HTML converter turns GitHub Flavored Markdown into clean, sanitized HTML that you can paste into a CMS, an email template or a static page. You can switch between the raw markup and a rendered view, copy just the HTML fragment, or download a full HTML document. Headings get id attributes for anchor links, and conversion runs entirely in your browser.

How Markdown converts to HTML

Each Markdown construct maps to a standard HTML element. "## Usage" becomes <h2 id="usage">Usage</h2>, **fast** becomes <strong>fast</strong>, a "- " list becomes <ul> with <li> items, and a fenced code block becomes <pre><code>, with the language tag (for example "bash") added as a class like language-bash. GitHub Flavored Markdown tables become a full <table> with <thead> and <tbody>, and column alignment is kept.

Heading ids are built by lowercasing the text, removing punctuation and replacing spaces with hyphens, so "Getting Started!" becomes id="getting-started".

Is converting Markdown to HTML safe?

Markdown allows inline HTML, so converting a file you didn't write can carry over a script tag, an onerror attribute or a javascript: link. This converter runs every result through DOMPurify before showing or exporting it. That removes scripts and event handlers, and this tool also strips style, iframe and form elements and inline style attributes.

As a result, the HTML you copy is a safe fragment to drop into a page. Harmless inline HTML, such as a <details> block or a <br>, is kept.

Copy HTML vs. Download .html

Copy HTML gives you only the converted fragment, with no html, head or body tags. That's what you want when pasting into a blog editor, a CMS field or an existing template. Download .html wraps the same fragment in a minimal standalone page with a doctype, a UTF-8 charset and a basic title, so the file opens correctly in any browser and can be shared as is.

Common use cases

  • Publishing Markdown docs to a CMS or blog that only accepts HTML
  • Building HTML email or newsletter content from Markdown drafts
  • Turning a README into a standalone HTML page to share
  • Embedding release notes in a web app's "What's new" panel
  • Checking exactly what markup a Markdown snippet produces

FAQ

How do I convert Markdown to HTML?

Paste your Markdown into the input. The HTML appears in the Output panel right away, and you can copy it with Copy HTML or save it with Download .html.

Is the generated HTML sanitized?

Yes. The output is cleaned with DOMPurify, which removes scripts, event handlers and javascript: links. Style, iframe and form elements and inline style attributes are also stripped.

Does the HTML include ids on headings?

Yes. Each heading gets an id made from its text in lowercase, with punctuation removed and spaces turned into hyphens, so you can link to sections with #anchors.

Does it convert Markdown tables to HTML tables?

Yes. GitHub Flavored Markdown is enabled, so pipe tables become <table> elements and column alignment is kept.

Can I get a full HTML page instead of a fragment?

Yes. Download .html saves a complete document with a doctype and UTF-8 charset. Copy HTML gives you only the fragment.