Markdown to HTML

Paste Markdown and get standards-compliant HTML instantly, with toggles for autolinking, smart typography, hard line breaks and raw HTML passthrough.

Markdown in, standards-compliant HTML out. Everything converts as you type. The four toggles change how the parser behaves, and the preview below shows the rendered result so you can check the markup and the output at once.

Parser options

Preview

Markdown, CommonMark and the flavours in between

Why two parsers disagree about your document

Markdown was published in 2004 as a Perl script and a page of prose, with no formal grammar. That informality is why it spread, and also why the same document renders differently in different tools. The original implementation left dozens of cases undefined: what a list marker does when indented three spaces, how emphasis nests inside a word, whether a heading needs a blank line before it. Every implementer resolved those gaps by guessing, and they guessed differently.

CommonMark exists to close that gap. It is a precise specification with several hundred conformance tests covering exactly the ambiguous cases the original left open. This converter uses markdown-it, which passes the full CommonMark suite, so the output matches what GitHub, Reddit, Discourse and most modern tooling produce. If a document renders here, it will render the same way there.

GitHub Flavored Markdown is a superset layered on top: tables, strikethrough, task lists and autolinked URLs. Tables and task lists work in this tool, which is why the sample document includes both. The distinction matters when you are writing for a target you do not control, because a table is not part of CommonMark proper and a strict parser will pass it through as plain text.

What the four toggles actually change

Autolinking turns a bare URL into an anchor. It is convenient for changelogs and notes, but it is a deviation from CommonMark, which requires angle brackets around a bare link. Turn it off if the output must be portable to a strict parser.

Smart typography rewrites straight quotes into curly ones and converts -- into an en dash. This is right for prose and wrong for anything containing code fragments outside a code block, since it will happily mangle a command-line flag. Code spans and fenced blocks are always left alone.

Hard line breaks change what a single newline means. By default Markdown joins consecutive lines into one paragraph, which is what most documents assume. Chat-style input where people press Enter for a new line needs this on, or their formatting collapses.

Raw HTML passthrough is the one with security consequences. With it off, an <img onerror=...> in the source is escaped and displayed as text. With it on, it is emitted as live markup. Leave it off for anything user-submitted.

Sanitising is a separate job

The most common mistake with any Markdown pipeline is assuming the converter protects you. It does not, and it is not supposed to. Even with raw HTML disabled, a link target is still attacker-controlled, so [click](javascript:alert(1)) produces an anchor a browser may honour. Markdown syntax alone is enough to build a working attack.

The correct pattern is convert, then sanitise, then insert. Run the HTML through a dedicated sanitiser such as DOMPurify with an allowlist of tags and attributes, and only then put it in the page. Do this on the server if the content will be shown to anyone other than its author, because client-side sanitising can be bypassed by anyone who can talk to your API directly. This tool renders its preview locally in your own browser with your own input, which is a different threat model from publishing someone else's Markdown.

Open-source note: rendering is powered by markdown-it, released under the MIT licence.

FAQ

Which Markdown dialect does this follow?
CommonMark, plus the GitHub extensions that markdown-it enables by default such as tables and task lists. It passes the full CommonMark conformance suite, so output matches GitHub, Discourse and most modern renderers.
Is the generated HTML safe to publish directly?
No. Always run it through a sanitiser like DOMPurify before inserting it into a page, especially for content you did not write. Even with raw HTML disabled, link targets remain attacker-controlled and a javascript: URL can slip through.
Why did my single line breaks disappear?
Standard Markdown joins consecutive lines into one paragraph; a hard break needs two trailing spaces or a blank line. Enable the single-newline toggle if your source is chat-style text where every Enter should become a line break.
Can I paste HTML into the Markdown side?
Yes, if you enable the raw HTML option. Otherwise tags are escaped and shown as literal text, which is the safe default. Mixing raw HTML into Markdown is valid but blocks must be separated by blank lines to parse as intended.
Is my content uploaded anywhere?
No. markdown-it runs entirely in your browser and the page makes no network request with your text. You can load the page, go offline and keep converting.
Why does smart typography break my code?
It rewrites quotes and dashes across prose, so a flag like --dry-run written outside a code span becomes an en dash. Wrap code fragments in backticks; the parser never applies typographic substitution inside code spans or fenced blocks.