Pro Every tool, icon and stickerAll of Pro for $5.99/month

  • All 85 tools
  • Festival Post Maker
  • Icon & sticker pack ZIPs
Go Pro
HubToolify
Text Tools

Markdown to HTML Pro

Turn Markdown into HTML with a live preview, or paste HTML and get Markdown back. The conversion is cleaned before it is shown, and a table of contents is built from your headings. Free preview · Pro required to export. Convert and copy up to 3,000 characters free. Pro removes this limit and adds downloads.

Free preview · Pro required to export. Convert and copy up to 3,000 characters free. Pro removes this limit and adds downloads.

Loading…

Why use this tool?

  • Writing in Markdown is quicker than typing tags, and a CMS or email tool often wants the HTML at the end.
  • Going the other way helps when you are moving old web content into a README, a wiki or a static-site repository that uses Markdown.
  • Pasted content can carry scripts or odd attributes. Every conversion to HTML is run through DOMPurify, a sanitiser, so the preview and the output stay clean.
  • A table of contents saves building a long list of heading links by hand for a long document.

How to use Markdown to HTML

  1. Choose a direction at the top: "Markdown → HTML" or "HTML → Markdown".
  2. Type or paste into the left box. It starts with a short sample you can replace, and "Clear" empties it.
  3. Look at the right-hand panel. "Preview" shows the rendered result, and "HTML" (or "Markdown") shows the code. Tick "Indent" to lay the HTML out readably.
  4. Press "Copy HTML" or "Copy Markdown". "Download" saves converted.html, as a small full page, or converted.md.
  5. For a table of contents, copy it from the heading list under the output. Ticking "Prepend it when copying the Markdown source" adds a "Copy Markdown with contents" button.

Features

  • GitHub-flavoured Markdown: tables, task lists, fenced code blocks and strikethrough
  • Conversion in both directions, with the current output carried over when you switch
  • Live preview of the rendered HTML
  • Output sanitised with DOMPurify, and the HTML you paste for the reverse direction is sanitised too
  • Indented HTML output, switched on by default
  • A table of contents from headings level 1 to 4, written as a Markdown list of links
  • Counts for characters in, characters out, output size and number of headings

Supported formats

Accepts Markdown or HTML text. Outputs HTML (copied as a fragment, or downloaded as converted.html wrapped in a minimal page) or Markdown (converted.md).

Tips

  • Leave a blank line before and after lists, tables and code blocks. Missing blank lines are the usual reason a block does not render.
  • Add a language after the opening fence, such as ```js, so the code block carries a language class.
  • When converting HTML to Markdown, tags with no Markdown equivalent are kept as HTML. That is valid Markdown, but check the result if you expected plain text.
  • The generated links in the table of contents use heading slugs in the GitHub style, so they work best where your site or repository builds heading anchors the same way.

Frequently asked questions

Is it safe to paste untrusted Markdown?

The conversion is sanitised with DOMPurify before it is displayed, which removes scripts and event handlers. Treat any output you publish elsewhere with the same care you would give any outside content.

Which Markdown flavour does it use?

GitHub-flavoured Markdown, through the marked library, with line breaks off. A single newline inside a paragraph does not become a line break.

Does converting HTML back to Markdown lose anything?

Common elements such as headings, links, images, lists, tables, code and quotes convert cleanly. Scripts and styles are dropped, and tags with no Markdown form stay as HTML.

Why are my heading anchors not working?

The table of contents links to GitHub-style slugs, such as #what-it-handles. They resolve only if the place you publish to gives headings matching ids.

Is my text uploaded?

No. The conversion and sanitising happen in your browser, and the text is not sent to HubToolify.

Can I try this Pro tool without an account?

Yes. Convert and copy up to 3,000 characters free. Pro removes this limit and adds downloads. Your own input is processed locally in your browser.

Will upgrading keep my work?

Checkout and login open in a separate tab. Keep the workspace open to retain inputs, settings and previews. Files stay in that tab only; keep the originals in case you close or reload it. Export access is checked with the server after payment.

Your files are processed directly in your browser and are not uploaded to HubToolify's servers.