Markdown to HTML
Write or paste Markdown and get clean, sanitised HTML as you type — a fragment for your CMS or a complete page. With a live preview, and nothing uploaded.
Or drop a .md file, or browse
HTML
Markdown in, HTML out
Markdown is the pleasant way to write; HTML is what browsers, email clients and most CMS editors actually take. This converter produces plain, semantic HTML — no wrapper divs, no inline styles, no framework classes — so it drops into any design and inherits its styling.
Why the output is sanitised
Markdown allows raw HTML, so a Markdown file from someone else can hide a <script> or an onerror handler. Pasting that into a CMS is a classic way to inject code into a site. Every conversion here goes through DOMPurify first, so what you copy is safe to publish.
Other formats
Need a document rather than a web page? Markdown to PDF draws Mermaid diagrams and LaTeX math too. Starting from a page you already have? HTML to Markdown goes the other way. New to the syntax? Start with the cheat sheet.
Frequently asked questions
Fragment or complete page — which do I need?
A fragment (the default) is just the converted content: <h1>, <p>, <ul> and so on, ready to paste into a CMS, an email template or an existing page. A complete page wraps it in <!doctype html>, <head> and a little CSS so it opens nicely on its own in a browser; its <title> is taken from the first heading.
Which Markdown syntax is supported?
GitHub-flavored Markdown: headings, emphasis, links, images, lists, task lists, pipe tables with alignment, strikethrough, blockquotes and fenced code blocks, which keep their language as class="language-…" for any syntax highlighter. YAML front matter at the top of the file is left out of the HTML.
Is the output safe to put on my site?
The HTML is sanitised with DOMPurify: <script> tags, inline event handlers such as onclick and javascript: links are removed, even if they were written into the Markdown as raw HTML. Harmless raw HTML such as <details> or <kbd> is kept.
What about Mermaid diagrams and math?
They are exported as their source — a ```mermaid code block and $…$ expressions — which is what GitHub, GitLab and most documentation generators expect and render themselves. For a document with the diagrams and equations drawn, use Markdown to PDF.
Is my Markdown uploaded?
No. The conversion runs in your browser as you type. Nothing is sent to a server or stored.
Limitations
- Mermaid diagrams and math are exported as source, not drawn.
- Footnotes, definition lists and other extensions beyond GitHub-flavored Markdown are not converted.
Related tools
- HTML to MarkdownPaste HTML, a web page or a Google Doc — get Markdown.HTML, Clipboard → Markdown (.md)
- Markdown to PDFA clean PDF from Markdown — with diagrams, math and images.Markdown (.md) → PDF
- Word to MarkdownTurn a .docx into clean Markdown — headings, lists, tables, images.Word (.docx) → Markdown (.md), ZIP
- PDF to MarkdownClean Markdown from any PDF, with OCR for scanned pages.PDF → Markdown (.md)
Guides
- Markdown vs HTML: What Each Is For, and When to ConvertMarkdown and HTML describe the same structure for different jobs. What each is for, what Markdown cannot express, and how to convert safely.
- Markdown Cheat Sheet PDF (Free Download)Free Markdown cheat sheet with every syntax element - headings, lists, links, tables, code - plus GFM extras. Download it as a printable PDF in one click.
- What Is Markdown? A Complete Beginner's GuideWhat is Markdown? Learn the history, core syntax with examples, flavors like CommonMark and GFM, the best tools, and why writers and developers rely on it.
- Markdown Frontmatter Explained (YAML Guide)What Markdown frontmatter is, how YAML metadata works, the fields Obsidian, Hugo, and Jekyll expect, common syntax errors, and how to avoid breaking your build.