Skip to content
PocketDesk
Your files are processed on your device, never uploaded

Markdown to HTML

  • On device
Input
Ln 1, Col 11 line0 BUTF-8

Paste, drop or open a file in Input to see the result here.

Waiting for input
  • ⌘Enter Run now
  • ⌘⇧C Copy result
  • ⌘F Find in result
  • Esc Exit full screen
  • Use Ctrl instead of ⌘ on Windows and Linux

How to convert Markdown to HTML

  1. Type or paste Markdown in the left box. You can also drop a .md file on it.
  2. The HTML source appears on the right, with a live preview below it.
  3. Select Copy to put the HTML on your clipboard or Download to save a .html file.

Use the options at the top to turn GitHub-style tables and task lists on or off, or to turn single line breaks into <br> tags.

What Markdown is

Markdown is a plain text way of writing formatted documents. A # makes a heading, asterisks make bold or italic text, and a dash starts a list item. It was designed to be readable as plain text and to convert cleanly to HTML, which is why README files, documentation sites, blogs and chat tools all use it.

This converter uses the marked library, which follows the CommonMark rules, plus the common GitHub extensions. The HTML it produces is then sanitized so that pasted content cannot run scripts in your page.

Why sanitizing matters

Markdown allows raw HTML, so a document can contain a script tag or an onerror attribute that runs code when displayed. If you show converted text from someone else, that is a security risk called cross-site scripting. DOMPurify removes the dangerous parts and keeps the safe formatting. The preview you see is the sanitized result, so what you see is what you copy.

Tips

  • Leave a blank line between paragraphs, lists and headings. Missing blank lines are the most common reason for odd output.
  • Use fenced code blocks with three backticks, and add a language name after them for syntax highlighting in the page that shows the HTML.
  • The output has no styles. Your site’s CSS decides how headings, tables and code blocks look.
  • Going the other way? Use HTML to Markdown to turn a web snippet back into Markdown.
  • If you embed images as data, the image to Base64 tool makes the text for you.

Nothing is uploaded, and no account is needed.

Questions

Is the HTML safe to paste into a page?

The output is sanitized with DOMPurify, which removes scripts, event handlers and other unsafe markup. Still, review HTML before publishing it.

Which Markdown features are supported?

Headings, emphasis, lists, links, images, code blocks, quotes and, with the GitHub-style option on, tables, task lists and strikethrough.

Can I use raw HTML inside Markdown?

Yes, safe tags such as div, span or details pass through. Script tags and inline event handlers are removed.

Is my text uploaded?

No. The conversion and the preview both happen in your browser.

More developer tools