Markdown to HTML Converter

Convert Markdown to clean HTML with a live preview — headings, lists, links, code blocks and more, all in your browser.

1,101 views

How It Works

This converter follows the CommonMark specification — a precisely defined version of Markdown that resolves the ambiguities left open by the original 2004 Markdown description (how nested lists interact with loose paragraphs, what happens when a marker sits inside a blockquote, and so on). Parsing happens in two distinct passes. The first pass is block-level: the raw text is split into structural units — paragraphs, ATX headings (# through ######), fenced code blocks, blockquotes, ordered and unordered lists, horizontal rules — purely by reading line structure and indentation, without looking at what is inside each block yet. The second pass is inline-level: within each block, the parser scans for emphasis markers (*italic*, **bold**), inline code spans (`code`), and link or image syntax ([text](url)), rewriting them as the matching HTML tags. This two-phase design explains why an asterisk sitting inside a fenced code block is left untouched — code blocks are fully resolved in the first pass, before inline emphasis rules ever reach their contents.

Example: given ## Release Notes followed by a blank line and - **v2.1**: fixes, block-level parsing first identifies a heading and a list with one item; inline-level parsing then turns **v2.1** into <strong>v2.1</strong> inside the <li>. Tables follow the GFM (GitHub Flavored Markdown) extension layered on top of CommonMark: a header row, a --- separator row whose colon placement (:--, :-:, --:) sets column alignment, and any number of data rows below.

What to Know

  • Raw HTML is escaped, not executed — pasting a script tag or an inline event handler renders as visible text instead of running, a deliberate safety choice for pasted or untrusted content.
  • Loose vs. tight lists change the output — a blank line between list items forces CommonMark to wrap each item in its own <p> (a "loose" list); no blank lines keep items as plain inline content (a "tight" list), which changes vertical spacing in the rendered HTML.
  • Very deep nesting has a practical ceiling — four-plus levels of nested lists or reference-style link definitions are valid CommonMark, but are edge cases better served by a dedicated build-time parser than a browser-based live preview.

Frequently Asked Questions

Are tables supported?

Yes, via the GFM (GitHub Flavored Markdown) table extension: a header row, a --- separator row, and any number of data rows, all delimited by pipes. Putting a colon at either end of the separator cells (:--, :-:, --:) sets left, center or right alignment for that column — this is an extension on top of core CommonMark, not part of the original spec.

Why is my HTML tag showing as text instead of rendering?

By design. Raw HTML in the input is escaped rather than passed through to the output, so a pasted <script> tag or an onclick attribute shows up as literal text instead of executing — this is what keeps pasting untrusted content safe. Write the equivalent in Markdown syntax instead, or unescape manually afterward if you fully trust the source.

Does line spacing follow Markdown rules exactly?

Yes: a blank line between lines of text separates paragraphs, and ending a line with two trailing spaces before the newline produces a <br> instead of a paragraph break. A single newline in the middle of a paragraph is simply joined into the same line, exactly as CommonMark specifies — this trips up people coming from plain-text editors where every newline is meaningful.

Why does formatting inside a nested list or code block sometimes look unexpected?

Because parsing is two-phase: block structure (lists, code fences, quotes) is resolved first, purely from indentation and line markers, before any inline formatting (bold, italic, links) is applied inside each block. Content inside a fenced code block is never touched by the inline pass, so **this** stays literal text there instead of becoming bold — that is expected CommonMark behavior, not a bug.

What is the difference between core CommonMark and "GitHub Flavored" features?

Core CommonMark defines headings, emphasis, lists, blockquotes, code blocks and links precisely. Tables, strikethrough (~~text~~), and task list checkboxes ([ ] / [x]) are GFM extensions layered on top — widely supported by converters like this one, but not guaranteed in every strict CommonMark-only implementation you might paste output into later.

Comments

No comments yet — be the first to write one!

Similar Tools