Developer tool

Markdown to HTML Converter

Choose a conversion direction, paste your text and copy or download the result.

Runs in your browser. No upload.
Safe preview

About this tool

Markdown to HTML Converter made simple.

Convert GitHub Flavored Markdown—including tables, task lists and strikethrough—to HTML, or turn HTML back into Markdown. Preview output in a sandbox that blocks scripts and network requests. HTML output is sanitized before preview; conversion and preview happen locally.

Guide

Using Markdown to HTML Converter

The Markdown and HTML Converter turns Markdown into HTML, or HTML back into Markdown, inside your browser. Markdown mode understands GitHub Flavored Markdown such as tables, task lists and strikethrough. Before you see the HTML, it is cleaned with DOMPurify, and a locked-down preview shows how it looks. It is a converter, not a full security filter.

How to use it

  1. Pick a direction at the top: Markdown to HTML or HTML to Markdown. Paste your text into the input box, up to 500,000 characters.
  2. In Markdown mode, leave GitHub Flavored Markdown ticked if you use tables or task lists. Tick Turn line breaks into HTML breaks if every new line should become a line break.
  3. Press Convert. The result appears in the output box. In Markdown mode you can also open Safe preview to see the rendered result.
  4. Press Copy result to copy the text, or Download result to save converted.html or converted.md. Clear empties the boxes.

Worked examples

Markdown with a link and a task list

You enter
Mode
Markdown to HTML
Text
# Shopping Buy **milk** and [eggs](https://example.com). - [x] bread - [ ] jam
You get
Html
<h1>Shopping</h1> <p>Buy <strong>milk</strong> and <a href="https://example.com">eggs</a>.</p> <ul> <li><input checked="" disabled="" type="checkbox"> bread</li> <li><input disabled="" type="checkbox"> jam</li> </ul>

The task list items become disabled checkboxes, one ticked and one empty. The link keeps its address because it starts with https.

Run through the tool’s own code.

Markdown that contains unsafe HTML

You enter
Mode
Markdown to HTML
Text
Hello <script>alert(1)</script>world <img src=x onerror=alert(1)> [bad](javascript:alert(1))
You get
Html
<p>Hello world <img src="x"> <a>bad</a></p>

The script element and the onerror attribute are removed, and the javascript: link loses its address, so the link text is left without a target. The image tag stays, because images are allowed.

Run through the tool’s own code.

HTML to Markdown

You enter
Mode
HTML to Markdown
Text
<h2>Plan</h2><p>Buy <b>milk</b> and <a href="https://example.com">eggs</a></p><ul><li>one</li><li>two</li></ul>
You get
Markdown
## Plan Buy **milk** and [eggs](https://example.com) - one - two

Headings use the hash style and list items use a dash. The list marker is followed by three spaces, which is how the converter library writes list items.

Run through the tool’s own code.

An HTML table going back to Markdown

You enter
Mode
HTML to Markdown
Text
<table><thead><tr><th>a</th><th>b</th></tr></thead><tbody><tr><td>1</td><td>2</td></tr></tbody></table>
You get
Markdown
a b 1 2

In this direction the table is not turned into a Markdown table. Each cell becomes its own paragraph, so you would need to rebuild the table by hand.

Run through the tool’s own code.

When it helps

  • Turn a README or notes written in Markdown into HTML you can paste into a page or an email template.
  • Convert copied HTML from a web page into Markdown for a wiki or a notes app.
  • Preview how a table or a task list will render before you publish it.
  • Check which parts of pasted HTML get stripped by a sanitizer.

Limits to keep in mind

  • Input is limited to 500,000 characters, and an empty box shows the message Paste text before converting.
  • The HTML is cleaned with DOMPurify's HTML profile. In tests it removed script, iframe, SVG and math elements, event-handler attributes and javascript: links, but it kept style elements, forms, inline style attributes and remote images.
  • Cleaning does not make the HTML right for every use. If you insert it into your own site, apply your own rules and security settings as well.
  • HTML to Markdown does not make Markdown tables or strikethrough. The result follows the default behavior of the Turndown library with hash headings and dash bullets.

Tips

  • If you only need a quick look, open Safe preview. It blocks scripts and removes link and image addresses, so what you see is not clickable.
  • Tick the line-break option only when your Markdown relies on single new lines, as in chat or poetry. Standard Markdown joins them into one paragraph.
  • After converting a table from HTML, rebuild it with pipes and dashes if you need a Markdown table.

Sources

Common questions

About Markdown to HTML Converter.

How do I convert Markdown to HTML?

Choose Markdown to HTML, paste your Markdown and press Convert. The HTML appears in the output box. Copy it or download it as converted.html. GitHub Flavored Markdown is switched on by default.

Is the HTML sanitized?

Yes. After conversion, the HTML is passed through DOMPurify with its HTML profile. In tests it dropped scripts and event attributes, but it left style elements, forms and remote images in place. Treat it as cleaned, not as a complete security check.

Does the preview run scripts or load links?

No. The preview sits in a sandboxed frame with a strict content policy, and the preview copy has link and image addresses removed. It is meant for looking at the layout only.

What is the line-break option for?

With it on, a single new line in your Markdown becomes a break tag. With it off, two lines in a row are joined into one paragraph, which is the usual Markdown behavior. The option only appears in Markdown mode.

Does HTML to Markdown clean the HTML too?

Yes. The HTML is cleaned with DOMPurify first, so scripts and event attributes disappear before the Markdown is made. Tables are not kept as tables, and each cell turns into a paragraph.

What is the difference between Markdown and GitHub Flavored Markdown?

GitHub Flavored Markdown adds a few extras to the basic rules, such as tables, task lists and strikethrough. If you untick the option, those extras are no longer converted and appear as plain text.

Is my text sent to a server?

No. The conversion, the cleaning and the preview happen in your browser. The tool only loads its own helper scripts from this site when you press Convert.

Is the HTML preview safe?

The preview sanitizes HTML and runs inside a sandbox that blocks scripts and external network connections. Review generated HTML before using it on a site.