Markdown ↔ HTML Converter

Convert Markdown to clean HTML or HTML back to Markdown — with syntax highlighting, safe link handling and a live rendered preview.

🔒 Runs entirely in your browser — nothing you type is uploaded or stored on a server.

The Markdown ↔ HTML Converter translates between CommonMark-style Markdown and clean HTML in both directions. Paste Markdown to generate semantic HTML with a live side-by-side rendered preview, or paste HTML markup to convert it back into clean Markdown formatting.

Also on Txtset: strip HTML tags down to plain text.

It supports standard Markdown features: ATX headings (# through ######), blockquotes, unordered and ordered lists, inline formatting (**bold**, *italic*, ~~strikethrough~~, `inline code`), fenced code blocks with language annotations, horizontal rules, images, and links.

Built with security and privacy as first principles, the conversion is hand-rolled with zero external third-party dependencies. Raw HTML embedded in Markdown is escaped rather than executed, and generated anchor tags automatically include rel="nofollow ugc noopener" with safe protocol filtering. Everything runs client-side in your browser.

How to use

  1. Choose your conversion direction: 'Markdown → HTML' or 'HTML → Markdown'.
  2. Paste your source text into the input textarea.
  3. Review the generated code in the output box alongside the live rendered visual preview.
  4. Click 'Copy output' to copy the converted HTML or Markdown to your clipboard.

Examples

Converting ChatGPT Markdown
Paste AI-generated Markdown with code blocks and bullet lists to get clean, embeddable HTML for your CMS.
Converting blog HTML to Markdown
Switch direction to HTML → Markdown and paste web page articles to convert them into README or note format.
Formatting headings and links
“# Title with link” converts to “<h1>Title with link</h1>”">Txtset”.
Code block formatting
Fenced code blocks with language tags convert to proper `
` structures.

Frequently asked questions

What Markdown syntax is supported?
Headings, paragraphs, ordered/unordered lists, blockquotes, bold, italic, strikethrough, inline code, fenced code blocks with language tags, horizontal rules, links, and images.
Is raw HTML passed through?
No. For security and cross-site scripting prevention, raw HTML tags in Markdown input are safely escaped into HTML entities.
How does HTML to Markdown conversion work?
It uses the browser's native DOMParser to safely walk the document node tree, converting semantic HTML elements into clean Markdown syntax without running scripts.
Does it work offline?
Yes. The parser is completely self-contained pure JavaScript with zero external libraries or network calls.
Is my text private?
Yes. Conversion occurs 100% on your device; nothing you paste is logged or sent to a server.