Free • Online • Private

Markdown to HTML Converter

Paste Markdown or open an .md file and get clean HTML you can copy or download. Choose an HTML fragment or a full document. It all runs in your browser.

Markdown
HTML source
Output

Open a .md file or paste Markdown to get its HTML.

Export

Runs in your browser · Nothing is uploaded

Benefits

MD to HTML Without the Fuss

Readable HTML

the output is indented, one block per line, so you can read it and paste it anywhere

Fragment or full document

get just the body markup, or a complete page with doctype, charset and a title

GitHub Flavored Markdown

tables, task lists, strikethrough and fenced code blocks all convert

Highlighted code, math and diagrams

fenced code with a language is highlighted with hljs classes, math becomes KaTeX HTML, and Mermaid blocks become inline SVG

Sanitized output

scripts, event handlers and javascript: links in the Markdown are stripped

Nothing is uploaded

conversion happens on your device, with no server and no account

Simple Process

How to Convert Markdown to HTML

1

Paste or open

Paste Markdown into the left panel, or drop an .md file anywhere on the page.

2

Pick the output

Choose an HTML fragment for a CMS or template, or a full HTML document, with or without basic styles.

3

Copy or download

Click Copy HTML to put it on your clipboard, or Download .html to save it as a file.

What gets converted

The HTML comes from the marked library with GitHub Flavored Markdown on, cleaned by DOMPurify, then indented so it is easy to read. Each row below was checked against the tool's actual output.

Markdown Converted? HTML output
# to ###### headings Yes <h1> to <h6> with GitHub-style id attributes, so #installation links work
Paragraphs Yes <p>
Two trailing spaces or a trailing backslash Yes <br>
**bold**, *italic*, ~~strike~~ Yes <strong>, <em>, <del>
Links and bare www. addresses Yes <a href>
Images Yes <img src alt>, with the path kept exactly as written
Bulleted, numbered and nested lists Yes <ul>, <ol> and <li>
Task lists - [x] Yes <li> with a disabled checkbox <input>
Pipe tables with alignment Yes <table> with <thead>, <tbody> and align attributes
Fenced code with a language Yes <pre><code class="hljs language-js"> with highlight.js spans; the full document's styles include the colors
Blockquotes and --- rules Yes <blockquote> and <hr>
Safe raw HTML such as <details> or <sup> Yes Kept
<script>, <style>, forms, onclick, javascript: links No Removed
YAML front matter Partial Becomes an <hr> and an <h2>, so delete it first
Math ($x^2$, $$...$$) Yes KaTeX HTML; the full document links the KaTeX stylesheet it needs
Mermaid diagrams Yes Inline <svg>
Footnotes No Not converted

The full-document option adds <!doctype html>, a UTF-8 charset, a viewport tag and a <title> taken from the first heading. The optional styles are a short embedded stylesheet for readable type, tables and code.

Common problems and fixes

My CMS shows the tags as text

Most editors have a visual mode and an HTML or code mode. Pasting HTML into the visual mode shows the tags as text. Switch to the HTML, Code or Custom HTML block first, then paste the fragment. If you want to paste formatted text into a visual editor instead, use Markdown to Google Docs, which copies rich text.

Code blocks have no colors

Colors come from highlight.js classes such as hljs-keyword, and the stylesheet for them is only in the full-document output. If you copied a fragment, either load highlight.js and a theme on your site, or switch to the full document and copy its <style> block. Blocks with no language on the fence, or a language the tool doesn't ship, stay plain.

Math shows as scattered symbols

Math is converted to KaTeX HTML, which needs the KaTeX stylesheet and fonts. The full document links it; a fragment pasted into your own page needs the same <link> in its head.

The page looks plain in an email

The optional styles sit in a <style> block, and many email clients ignore or strip those. For email, copy the document as rich text from Markdown to Google Docs, which puts the styles inline, and paste it into the message.

Images are broken

Image paths are copied exactly. A relative path such as images/chart.png needs the image file to sit in that place next to your HTML file, or a full https:// address.

Other ways to convert Markdown to HTML

  • Pandoc. pandoc -f gfm -t html -s notes.md -o notes.html writes a standalone page; leave out -s for a fragment. With -f markdown, Pandoc's own dialect, it also handles footnotes and math, and it supports page templates, which makes it the stronger choice for long documents.
  • Libraries. marked (the library this page uses) and markdown-it in JavaScript, or Python-Markdown in Python, do the conversion inside your own code.
  • VS Code. The built-in preview (Ctrl+Shift+V) shows the rendered page; extensions such as Markdown All in One add an export to HTML.
  • Static site generators. Hugo, Jekyll, Astro and Eleventy turn a folder of .md files into a whole website.

Use this page when you want clean HTML from one document right now, with nothing to install and nothing uploaded.

FAQ

Markdown to HTML FAQ

Have HTML and need Markdown instead?

Convert HTML, PDF, Word and other files to Markdown in your browser.

HTML to Markdown