DevKit

Markdown to HTML

Write Markdown on the left, get escaped, ready-to-paste HTML on the right.

Free No sign-up Runs in your browser
Markdown
Rendered

Markdown, and where it stops

Markdown was designed as "plain text that reads well as plain text" — a syntax simple enough that an unrendered README is still legible. Headings with #, emphasis with *, lists with -: the whole core syntax fits on one page.

That simplicity is also its limit. Nested lists, footnotes, definition lists, math and diagrams all needed extensions (CommonMark, GFM, MDX, KaTeX). This converter implements the common subset you actually use in READMEs and blog posts: headings, paragraphs, bold/italic, strikethrough, inline code, fenced code blocks, links, images, blockquotes, ordered and unordered lists, horizontal rules and pipe tables.

Safety comes first

Raw HTML in Markdown is a security problem: a comment containing <script> renders as executable code. This converter escapes all HTML in the input before applying Markdown syntax, so <div> in your text appears literally rather than becoming an element. Links get rel="nofollow noopener" to avoid leaking the opener context and to keep user-generated links from passing ranking signals.

Preview is not the same as valid HTML

The generated markup is deliberately plain — no classes, no wrapper divs, no inline styles. That is what you want when pasting into a CMS, a template, or an email builder that applies its own styling. If you need styled output, add your own CSS scoped to the container.

Escaping and line breaks

In Markdown, a single newline inside a paragraph is not a line break; it is treated as a space. Two trailing spaces or a backslash force a hard break. Blank lines separate blocks. Getting this wrong is the most common reason a paragraph "merges" when rendered.

When to reach for a real parser

For production content pipelines use a maintained implementation — markdown-it, remark, Goldmark, or cmark — with a strict HTML policy. A hand-written converter like this one is ideal for a quick conversion, not for rendering untrusted user content at scale.

Frequently asked questions

Is the output safe to paste into a website?
Input HTML is escaped, so no scripts can pass through. Still, review the result before publishing, and if you render user-submitted Markdown, run it through a sanitiser with an allow-list.
Which Markdown flavour is supported?
A practical subset of CommonMark plus GFM tables and strikethrough. Footnotes, task lists, math and MDX components are not supported.
Why did my line break disappear?
Markdown joins consecutive lines into one paragraph. Add two trailing spaces or a blank line to force a break or a new block.
Can I convert HTML back to Markdown?
Not on this page. The reverse direction is lossy and needs heuristics — use a library such as turndown if you need it.

Related tools