Markdown / HTML
Render Markdown or turn HTML back into Markdown
Markdown was designed so that the source reads as comfortably as the output: a heading is a line starting with a hash, emphasis is a pair of asterisks, a list is a line starting with a dash. Its original definition was a Perl script rather than a specification, which is why implementations diverged and why CommonMark was written to pin down the ambiguous cases.
Converting Markdown to HTML is the everyday direction, for a static site or a comment field. The reverse — HTML back to Markdown — is the one people reach for when migrating content out of a CMS, and it is inherently lossy: HTML can express things Markdown has no syntax for, so those either survive as raw HTML or disappear.
How to use it
- Paste Markdown or HTMLThe conversion runs in the direction you choose, with tables, fenced code blocks, task lists and links all supported.
- Read the generated HTMLOutput is plain, unstyled and semantic, so it can be dropped into a template that supplies its own CSS rather than fighting inline styles.
- Convert HTML back for migrationsAttributes, inline styles and elements with no Markdown equivalent are the parts to check by hand after a bulk conversion.
Frequently asked questions
Which Markdown flavour does this follow?
The CommonMark core plus the GitHub-flavoured extensions people actually rely on: tables, fenced code with language hints, strikethrough, task lists and automatic links. Those extensions are not in the CommonMark spec itself, which is why the same document can render differently on two sites.
Can I put raw HTML inside Markdown?
Most parsers allow it, and it is the standard escape hatch for anything Markdown cannot express. The caveat is security: if the Markdown came from a user, permitting raw HTML permits script tags. Renderers handling untrusted input should either disable HTML or sanitise the output.
Why did my line breaks disappear?
A single newline is treated as a space, because Markdown reflows paragraphs. To force a break you need either two trailing spaces at the end of the line or a blank line to start a new paragraph. Some renderers add a break-on-newline option, which is convenient and non-standard.
Is converting HTML to Markdown lossless?
No. Class names, inline styles, data attributes, iframes and nested layout markup have no Markdown equivalent, so they are either preserved as embedded HTML or dropped. Treat a bulk HTML-to-Markdown migration as a first pass that still needs review.
How do I show a literal asterisk or underscore?
Escape it with a backslash, or wrap it in backticks if it belongs to code. This matters most for filenames and identifiers containing underscores, where snake_case_names can otherwise be rendered as italics mid-word.