StringMash.com

Markdown to HTML

Headings, emphasis, links, lists, code and tables, turned into plain HTML.

Conversion
93 characters
Updates as you type
Escaped and indented

Using the converter

Type or paste Markdown on the left and the HTML appears on the right. Swap the boxes to go backwards.

The output is escaped, so a < in your text becomes &lt; rather than opening a tag. An entity you typed yourself, such as &copy;, is left as it is. Code spans are pulled out before anything else runs, so **this** stays literal.

What it covers

ATX and setext headings, bold, italic, strikethrough, inline code, fenced code with a language class, indented code, links, images, ordered and unordered lists with nesting, blockquotes, horizontal rules and pipe tables.

Reference links work, with the definition anywhere in the document. GitHub's extras are in too. Colons in a table's delimiter row align the column, so :--: centres it. An item that starts [x] or [ ] becomes a disabled checkbox, the way GitHub draws it. A bare URL such as www.example.com turns into a link. So does an email address, with mailto: added.

Left out on purpose: footnotes and raw HTML blocks. Those are the parts flavours disagree about most, and a converter that half-supports them produces output you have to check by hand anyway.

Two trailing spaces still make a hard line break, which is the one piece of Markdown syntax nobody can see in their own file. A backslash at the end of a line does the same, and is easier to spot.

The spec was a Perl script

John Gruber released Markdown in March 2004, with help from Aaron Swartz on the syntax. What shipped was a description in prose and a Perl script called Markdown.pl, and where the two disagreed the script won.

Gruber described Markdown in prose, with no formal grammar. The description never said how far a sublist had to be indented, or whether a heading needed a blank line before it, so every implementation answered differently and all of them were defensible. In 2012 Jeff Atwood counted dozens of flavours, all with differences in the way they behave.

CommonMark started in 2014 to settle it with a real specification and a test suite that any implementation could be measured against, and Gruber objected to the original name, Standard Markdown, so it was renamed. GitHub switched its own rendering over in 2017. This converter follows the common ground.

Related conversions

HTML to Markdown is the return trip, and it loses more than you might expect. Remove line breaks is worth running first on Markdown pasted out of a hard-wrapped email.

For what the characters are underneath, text to hex shows the bytes.

Questions

How do I convert Markdown to HTML?

Paste the Markdown above and copy the HTML. It runs in your browser, so a draft you haven't published stays on your machine.

Which flavour of Markdown is this?

The common ground rather than any one flavour: the CommonMark core plus GitHub's tables, task lists, strikethrough and bare URL and email links. Footnotes are out. So are raw HTML blocks.

Is the HTML safe to publish?

The text is escaped, so angle brackets in your source can't open a tag. Link and image URLs are copied through as written, so check those if the Markdown came from somewhere you don't control.

Why didn't my asterisks turn into bold?

Emphasis needs the marker against the text, so **like this** rather than ** like this **. Markers inside a code span are left alone deliberately. So is a _ inside a word, as in snake_case_word, and a marker with a backslash in front.

Sources

Added . Last updated and reviewed . What's new