loot.tools

Markdown ⇄ HTML Converter

Convert between Markdown and HTML in both directions. Markdown to HTML renders the markup as a copyable string, with options to sanitize out scripts, pretty-print, and treat single line breaks as <br>. HTML to Markdown walks the markup and writes clean Markdown. Headings, bold, italic, strikethrough, links, images, ordered and unordered lists, blockquotes, inline and fenced code, and tables all convert. Unknown tags fall back to their text so nothing gets dropped. Runs fully client-side.

Convert between Markdown and HTML both ways. Headings, bold, italic, links, images, lists, blockquotes, code, and tables all carry over. Anything without an equivalent falls back to its text so you never lose words.

Markdown
HTML

What this tool does

Flip a switch to convert either way. Markdown to HTML renders the matching tags and hands you the source to copy. HTML to Markdown walks an HTML snippet - a page section, an email body, content copied from a CMS - and writes the matching Markdown. Block elements like headings, paragraphs, lists, blockquotes, and tables keep their structure, and inline formatting like bold, italic, links, and code stays intact.

Why convert between the two

Markdown is easier to read, diff, and store, so HTML to Markdown is handy when you're moving content into a static site, a README, a wiki, or a docs tool that speaks Markdown. Going the other way, plenty of places take HTML but not Markdown - an email template, a CMS rich-text field, a comment box - so authoring in Markdown and converting here saves you from hand-writing tags.

Unknown tags, sanitize, and pretty-print

Going to Markdown, tags without an equivalent (a <span>, a <mark>, a custom element) are unwrapped to their text rather than dropped, and characters that would read as Markdown syntax are escaped. Going to HTML, sanitizing removes anything unsafe (script tags, inline event handlers, javascript: URLs), pretty-printing re-indents the markup so it's readable, and the line-break option turns every newline into a <br>.