Markdown to HTML Converter

Convert Markdown to HTML, with a live preview of the result.

What is Markdown?

Markdown is a lightweight markup language created by John Gruber in 2004. Its guiding principle is that the source should be readable as plain text - you can understand a Markdown document without rendering it, which is not true of HTML.

It has become the default format for technical writing: README files, documentation sites, static blogs, GitHub issues, Discord and Slack messages, and most note-taking applications all use some form of it.

Key takeaways

  • Markdown converts to HTML; it is a shorthand, not a replacement.
  • The original spec was loose, so CommonMark was created to standardize it.
  • GitHub Flavored Markdown adds tables, strikethrough and task lists.
  • Raw HTML is valid in most Markdown renderers; this converter shows it as text, for safety.
  • Different renderers produce different output for the same ambiguous source.

Markdown syntax reference

ElementMarkdownHTML output
Heading 1# Title<h1>Title</h1>
Heading 2## Subtitle<h2>Subtitle</h2>
Bold**text**<strong>text</strong>
Italic*text*<em>text</em>
Bold italic***text***<strong><em>text</em></strong>
Link[text](url)<a href="url">text</a>
Image![alt](src)<img src="src" alt="alt">
Inline code`code`<code>code</code>
Code block```lang ... ```<pre><code>...</code></pre>
Blockquote> quoted<blockquote>quoted</blockquote>
Bullet list- item<ul><li>item</li></ul>
Numbered list1. item<ol><li>item</li></ol>
Horizontal rule---<hr>
Line breakTwo trailing spaces<br>

GitHub Flavored Markdown extras

ElementSyntax
Table| A | B |
| --- | --- |
| 1 | 2 |
Strikethrough~~deleted~~
Task list- [x] done
- [ ] to do
Autolinkhttps://example.com becomes clickable
Fenced code with language```js for syntax highlighting
FootnoteText[^1] with [^1]: the note below

These are extensions, not part of the original Markdown or of CommonMark. Support varies by renderer, so check before relying on them outside GitHub. This converter handles the elements in the first table only (and turns every single line break inside a paragraph into a <br>); the extras above stay as plain text.

Why renderers disagree

Gruber's original specification was written informally and left many cases undefined, which meant different implementations produced different HTML from the same source. CommonMark was created specifically to fix this with a rigorous specification and a comprehensive test suite.

FlavorBasisNotable additions
Original MarkdownGruber, 2004The base syntax; ambiguous in places
CommonMarkStandardized specPrecise rules, no new syntax
GitHub FlavoredCommonMarkTables, task lists, strikethrough, autolinks
MultiMarkdownOriginalFootnotes, citations, metadata
Markdown ExtraOriginalTables, definition lists, attributes
The classic ambiguity. Does `*a*b*` produce emphasized "a" followed by "b*", or something else? The original spec did not say, and implementations differed. CommonMark defines an answer for every such case, which is why it is the sensible base for any new tool.

Practical tips

  • Leave a blank line between blocks. Most Markdown confusion comes from missing blank lines around lists, headings and code fences.
  • Use `-` consistently for bullets. Mixing `-`, `*` and `+` can create separate lists unintentionally.
  • Indent nested lists by two or four spaces and stay consistent - inconsistent indentation is the most common list bug.
  • Use fenced code blocks with a language tag rather than four-space indentation; they are clearer and enable highlighting.
  • Escape literal asterisks and underscores with a backslash when you mean the character rather than emphasis.
  • Raw HTML is allowed by most renderers for anything Markdown cannot express, though some strip it for security. This converter escapes it, so tags you type appear as text.
Everything happens in your browser. Your text is processed entirely on your own device using JavaScript. Nothing is uploaded, stored or logged, which means you can safely paste confidential drafts, client work or personal notes. Closing the tab discards everything.

Frequently Asked Questions

What is Markdown?

A lightweight markup language created by John Gruber in 2004, designed so the source reads naturally as plain text. It converts to HTML and has become the standard for README files, documentation, static blogs and most note-taking applications.

How do I convert Markdown to HTML?

Paste your Markdown into the tool and choose the Markdown to HTML direction. The converted markup appears immediately alongside a live preview showing how it will render.

Can I convert HTML back to Markdown?

Not with this tool, which converts in one direction only. HTML to Markdown is imperfect by nature anyway: HTML can express things Markdown cannot - arbitrary attributes, nested inline styles, custom elements - so complex markup either stays as raw HTML or loses detail. To get plain text out of HTML, use the HTML to text converter.

What is CommonMark?

A rigorous specification of Markdown created because Gruber's original description left many cases undefined, causing different renderers to produce different output from identical source. CommonMark defines precise rules and ships a comprehensive test suite.

What is GitHub Flavored Markdown?

GitHub's extension of CommonMark, adding tables, task lists, strikethrough, automatic linking of bare URLs and fenced code blocks with language tags. These are extensions, so support varies outside GitHub.

How do I create a table in Markdown?

Use pipes to separate columns and a row of dashes to separate the header from the body. Tables are a GitHub Flavored Markdown extension rather than part of the original syntax, so they will not render in every Markdown processor.

Can I use HTML inside Markdown?

In most renderers, yes: raw HTML is the usual escape hatch for anything the syntax cannot express. Some renderers strip it for security, particularly for untrusted user content, and this converter is one of them: it escapes raw HTML so it shows as text, refuses javascript: and data: links, and draws the preview in a sandboxed frame where no script can run. That way Markdown pasted from an unknown source cannot run code in your browser.

How do I force a line break in Markdown?

End the line with two spaces, or use a backslash at the end of the line in CommonMark. A single newline without either is treated as a soft wrap and joins the lines into one paragraph, which surprises people regularly.

Related Calculators