1. Home
  2. Writing & text tools
  3. Markdown ⇄ HTML Converter

Markdown ⇄ HTML Converter

Publish a README or notes as a web page, or turn a web page or CMS export back into Markdown for a static site, documentation or a notes app.

Free, no sign-up. Runs in your browser; see “Private by design” for the one online step.

How to use Markdown ⇄ HTML Converter

  1. Choose Markdown → HTML or HTML → Markdown.
  2. Paste or open the file.
  3. Copy or download the result and check the preview.

Features

  • GitHub Flavored Markdown: tables, task lists, strikethrough, autolinks
  • GitHub-style heading ids for anchors
  • Removes scripts and unsafe attributes
  • Full HTML page option
  • HTML tables become Markdown pipe tables

Supported formats

You can open

  • MD
  • HTML
  • Typed or pasted text

You get

  • HTML
  • MD

Private by design

Conversion happens in this browser. An image linked by its web address in your Markdown or HTML is loaded from the site that hosts it so the preview can show it, and that site receives your IP address and browser details. How local processing works

Good to know

  • Very large files are limited by your device’s memory; on a phone, split huge files into smaller parts first.

Guide

Converting Markdown to HTML and back

Markdown is the easiest way to write formatted text, and HTML is what the web displays. You need to go from one to the other when a README becomes a web page, notes go into an email or CMS, or an old blog moves to a static site generator that expects Markdown. This converter works both ways, with a live preview.

Markdown to HTML

Paste or open a .md file and the HTML appears beside it. The converter follows GitHub Flavored Markdown, so tables, task lists (- [x] done), strikethrough with tildes and bare links all work as they do on GitHub. Code blocks keep their language class, such as language-js, for syntax highlighters.

Heading anchors

With heading ids on, every heading gets an id using GitHub’s rules: lower case, punctuation removed, spaces turned into hyphens, and -1, -2 added when a heading repeats. A heading “Release notes” becomes id="release-notes", so links such as page.html#release-notes jump straight to it, and a table of contents made for GitHub works on your page too.

Safe output

Markdown may contain raw HTML, and HTML may contain scripts. With “Remove scripts and unsafe HTML” on, the output passes through DOMPurify, which removes script tags, event handlers such as onclick and javascript: links while keeping ordinary formatting. Keep it on whenever the Markdown came from someone else; if you turn it off and the output contains scripts or handlers, a warning appears. The preview below is always sanitised.

Snippet or full page

By default you get an HTML fragment to paste into a CMS, template or email editor. Choose “Full HTML page” to wrap it in a complete document with a doctype, a viewport tag for phones, a title taken from the first heading and simple readable styles, ready to open in a browser or upload.

HTML to Markdown

Switch direction and paste HTML. Headings become # lines, lists use hyphens, code blocks become fenced blocks with their language, struck-through text becomes text, checkboxes become task-list items and tables become pipe tables. The HTML is sanitised before conversion, so pasting a full page does not run anything.

What does not survive

Markdown is deliberately simple. Coloured or resized text, merged table cells, forms, embedded video and layout columns have no Markdown form: their text is kept and their styling dropped. Converting Markdown to HTML and back usually returns what you started with, apart from spacing and list markers.

A quick test

The Markdown sample — release notes with a table, a task list, struck-through text and a JavaScript code block — produces <h1 id="release-notes">, a <table> and a <del> element. Switching to HTML to Markdown and loading its sample returns # Release notes, a | Platform | Status | table, ~~Legacy sync~~ and a fenced js block.

Privacy note

Conversion runs in your browser. Images linked by web address are fetched from their host only to show them in the preview.

Using the output in email

Email programs ignore most stylesheets, so paste the snippet rather than the full page into an HTML email editor, and keep formatting simple: headings, paragraphs, bold, links and lists survive almost everywhere, while tables and code blocks may look different in each mail client.

Write and preview Markdown in the Markdown Editor, add a contents list with the Markdown TOC Generator, strip markup from HTML with Strip HTML Tags, or make a PDF with Markdown to PDF.

Checked against the current version of the Markdown ⇄ HTML Converter on .

Troubleshooting

The file does not open

Check that it is one of the supported formats above and opens in another app. Damaged files and password-protected PDFs cannot be read until they are repaired or unlocked.

It is slow or stops on a very large file

Everything runs on your device, so speed depends on its memory. Close other tabs, use a computer rather than a phone, or split the file into smaller parts first.

The download did not start

Look for your browser’s download bar or icon. Some browsers ask once before a site may download files; allow it and click the button again.

Frequently asked questions

Why do my line breaks disappear in the HTML?

In Markdown a single line break inside a paragraph is treated as a space; a blank line starts a new paragraph. Switch on “Single line breaks become br” if your text was written with one sentence per line, such as poems or addresses.

Can I paste a whole web page’s source?

Yes. Scripts, styles and unsafe attributes are removed first, then the content is converted. Navigation menus and footers come along too, so copy just the article element if you only want the main text.

Which Markdown dialect is used?

GitHub Flavored Markdown, the dialect of GitHub, GitLab, most static site generators and many notes apps. Plain CommonMark documents convert the same way, since GFM is a superset of it.

Is the HTML safe to publish?

With “Remove scripts and unsafe HTML” on, the output passes through DOMPurify, which strips script tags, event handlers and javascript: links. Keep it on for Markdown you did not write.

What happens to HTML with no Markdown form?

Coloured text, merged table cells, forms and embedded media have no Markdown equivalent. Their text is kept and the styling dropped, so check those parts of the result.

Is anything sent over the internet?

Conversion happens in this browser. An image linked by its web address in your Markdown or HTML is loaded from the site that hosts it so the preview can show it, and that site receives your IP address and browser details.

Keep working with the result

After you download, choose “Save to Workstand” to keep the result in a folder on your computer, attach it to a project and create a follow-up task. It is saved by your browser, not uploaded.