Markdown to HTML Converter
Convert Markdown to clean HTML in your browser. Headings, lists, code, links, images and quotes follow CommonMark; raw HTML is escaped by default. No upload.
Worked examples
- A README-style snippet
Headings, inline code, bold, italic, links with titles and a tight bullet list cover most of what a README contains.
- Raw HTML and a javascript: link
By default raw HTML is escaped to text and dangerous URL schemes are blanked, so pasted Markdown cannot inject script into your page.
- Nested list, quote, fenced code, image and rule
Shows nesting by indentation, how code in a fence is escaped but never interpreted, and the img and hr output.
What this does
Paste Markdown, get HTML. The converter is written from scratch for this site and implements a documented subset of CommonMark, the standard specification for Markdown. It runs in your browser with no dependencies and no upload, and by default it treats your Markdown as untrusted: raw HTML is escaped instead of passed through.
Supported syntax
This is the complete list. Anything not named here is not converted.
- Headings: ATX (
# Titleto###### Title, with optional closing hashes) and setext (a line underlined with===or---). - Paragraphs and line breaks: a single newline is a soft break, and two trailing spaces or a trailing backslash make a hard
<br />. - Inline:
**strong**,*emphasis*,__strong__,_emphasis_,`code`(including double-backtick spans), and backslash escapes such as\*. - Links and images:
[text](url "optional title")and, plus autolinks like<https://example.com>and<me@example.com>. - Code: fenced blocks with backticks or tildes, with the first word of the info string becoming
class="language-xxx", and indented code blocks (four spaces). - Lists: bullet (
-,*,+) and ordered (1.or1)) lists, nested by indentation, tight or loose, withstartset when an ordered list begins above 1. - Blockquotes (nestable, with lazy continuation lines) and thematic breaks (
---,***,___).
Not supported: tables, strikethrough, task lists, footnotes, reference-style links and definitions ([text][id]), and bare-URL autolinking. These are GitHub-flavored extensions or lower-priority CommonMark features, so output for documents using them differs from GitHub's rendering.
How it works and what is escaped
Parsing is two-pass. Block structure comes first: the input is split into lines, and each line is matched against fences, headings, rules, quotes and list markers, with nested content dedented and parsed recursively. Inline syntax is then parsed inside each paragraph or heading. Emphasis uses the CommonMark delimiter-run rules (left- and right-flanking, and the "rule of three"), which is why snake_case_name stays plain text and 2*3*4 is handled sensibly.
Safety defaults:
<,>,&and"in text are escaped, so<script>appears as text. Valid entity references such as©pass through untouched, as the spec requires.- Link and image URLs using
javascript:,vbscript:,data:orfile:are output as an empty URL. This blocks the classic[click](javascript:alert(1))attack. - Ticking Allow raw HTML passes inline tags and block-level HTML through unchanged. A raw HTML block ends at the first blank line. Use it only for Markdown you wrote or trust, because it also lets script tags through.
Edge cases
Adding heading ids gives each heading a lowercase hyphenated id, with -1, -2 appended to duplicates, which is similar to GitHub's anchors but not guaranteed identical for every Unicode character. Tabs at the start of a line count as tab stops of four. The output has no trailing newline and no wrapping <html>, <head> or <body>.
Because this is a subset, treat it as a convenient converter for common documents, not a drop-in for a full CommonMark library when you need exact parity, such as in a production pipeline.
When to use it
- Previewing what a README or changelog snippet will look like before publishing.
- Generating an HTML fragment for a CMS field or email template from Markdown notes.
- Checking how a particular nesting of lists and quotes is interpreted.
- Converting content on a machine where installing a Markdown library is not an option.
If you need the reverse, the HTML to Markdown converter handles the same subset in the other direction.
Frequently asked questions
- Which Markdown syntax is supported?
- ATX and setext headings, paragraphs, hard line breaks, **bold**, *italic*, `inline code`, backslash escapes, fenced and indented code blocks, inline links and images, <autolinks>, ordered and unordered lists (nested, tight or loose), blockquotes and horizontal rules. Tables, strikethrough, task lists, footnotes, reference-style links and bare-URL linking are not supported.
- Is the HTML output safe to put on a page?
- With the default settings, yes for the usual attacks: raw tags in the Markdown are escaped as text, and links or images using javascript:, vbscript:, data: or file: URLs are written with an empty URL. If you tick Allow raw HTML, tags are passed through untouched, so only do that for Markdown you trust or run the output through a sanitizer.
- Is this identical to GitHub's rendering?
- Not exactly. GitHub uses GFM, which adds tables, strikethrough, task lists and autolinked URLs on top of CommonMark. This tool implements a documented CommonMark subset, so use it for standard Markdown and expect differences on those GFM extras.
- Can it add ids to headings for anchor links?
- Yes. Turn on heading ids and each heading gets a lowercase, hyphenated id built from its text, with -1, -2 added to repeats, similar to the anchors GitHub generates.