Search DevTools

Jump to any tool or page

Markdown to HTML Converter

Convert markdown into clean HTML source with a live preview, GFM options, and sanitization on by default.

Options

Markdown

paste your markdown

HTML

Paste markdown on the left and the HTML appears here.

About this Markdown to HTML converter

Markdown is a plain-text authoring format; HTML is what a browser actually renders. This tool parses your markdown and hands you both sides of that translation — the generated HTML source you can paste into a template, and a live preview of how that markup renders.

CommonMark vs GFM

CommonMark is the strict specification: headings, emphasis, lists, links, blockquotes and code. GitHub Flavored Markdown adds four things CommonMark has no syntax for at all — pipe tables, strikethrough with ~~text~~, autolinks that turn a bare URL into an anchor without angle brackets, and task lists written as - [ ] and - [x]. Turn GFM off and those constructs fall through as literal text, which is exactly what you want when the output must survive a strict CommonMark pipeline.

Why sanitization is on by default

Markdown deliberately allows raw HTML to pass through untouched. That means a document you did not write can carry <script>, an <iframe>, an inline onerror handler on a broken image, or a javascript: href — and rendering it verbatim is a stored XSS bug. Sanitization strips executable tags, event-handler attributes and unsafe URL schemes while leaving the structural markup intact. Disable it only when you control the source and intend to keep embedded HTML such as a custom video embed.

The breaks option

In CommonMark a single newline is just whitespace — two lines of the same paragraph join into one line of output, and only a blank line or two trailing spaces produce a break. Chat-style editors trained people to expect otherwise, so breaks converts every single newline into a <br>. Useful for release notes and comment bodies, wrong for prose that was hard-wrapped at 80 columns.

Heading IDs

With header IDs enabled, each heading gets a slug derived from its text: lowercased, punctuation dropped, spaces replaced with hyphens, and a numeric suffix appended when two headings would otherwise collide. That is what makes #getting-started anchor links and generated tables of contents work. Leave it off when the HTML is a fragment dropped into a page whose IDs you do not own.

Everything runs in your browser — the markdown you paste never leaves the page.

Visual Creation

About Markdown to HTML Converter

Convert Markdown into HTML source you can paste into a template, CMS, or email, with a live preview of how it renders. Embedded raw HTML is sanitized by default, because Markdown permits arbitrary HTML and pasting unsanitized output into a page is a straightforward cross-site scripting vector.

Frequently asked questions

Why does my single line break disappear?
Because CommonMark treats a single newline as a soft break and renders it as a space, joining the lines into one paragraph. This surprises people coming from chat apps and note tools where Enter starts a new line. The portable fix is a blank line for a new paragraph, or two trailing spaces for a hard break. This tool also exposes a breaks option that converts every single newline to a br element, which is what GitHub comment fields do but is not standard CommonMark.
What is the difference between CommonMark and GitHub Flavored Markdown?
CommonMark is the strict specification that resolved the ambiguities in the original 2004 Markdown. GFM is a superset adding tables, strikethrough with double tildes, task list checkboxes, and autolinking of bare URLs. If your Markdown has pipe tables that render as literal pipes, you are on a parser without GFM enabled. Neither dialect includes footnotes, definition lists, or admonitions, which come from further extensions.
Why is sanitization on by default?
Because Markdown deliberately allows raw HTML to pass through, which means a script tag, an onerror attribute, or a javascript: URL in the source becomes live HTML in the output. If that output is rendered on a page containing anyone else's session, it is a stored XSS vulnerability. Sanitizing strips scripts, event handler attributes, and dangerous URL schemes while leaving ordinary formatting alone. Turn it off only when you fully control the input.
How are heading IDs generated?
By slugifying the heading text: lowercasing, replacing spaces with hyphens, and dropping punctuation, so A Quick Guide becomes a-quick-guide. Two headings with the same text produce the same slug, so parsers append a numeric suffix to keep anchors unique. The exact algorithm differs between renderers, which is why an anchor link that works on GitHub can break in a static site generator using a different slugifier.
Can I get a complete HTML file rather than a fragment?
Yes, the full document option wraps the output in a doctype, html, head with a charset declaration, and body. A bare fragment is what you want when injecting into an existing template; a full document is what you want when saving a standalone file, since without a charset meta tag a browser may guess the encoding and mangle any non-ASCII characters.