Open editor
HTML to Markdown

HTML to Markdown converter

Paste code into this HTML to Markdown converter and get tidy GitHub Flavored Markdown back, with headings, lists, links, images, tables and code blocks kept.

Why convert HTML to Markdown?

HTML is written for browsers. It is full of tags, classes and wrappers that make a document hard to read and hard to edit by hand. Markdown keeps the same structure, headings, lists, links and emphasis, in plain text that people can read and Git can compare line by line. It is also much shorter, which helps when the text is going into a prompt or a pull request.

When you convert HTML to Markdown here, each element is mapped to its markdown equivalent. <h2> becomes ##, <strong> becomes **bold**, <a> becomes a markdown link, and <pre> becomes a fenced code block. HTML tables become markdown tables with a header row, and task lists and strikethrough are supported. Scripts, styles, comments and navigation are dropped, and inline styling such as colours and fonts is left out because markdown has no way to express it.

You can choose how the output looks: # or underlined headings, - or * bullets, and fenced or indented code. The HTML to MD conversion updates as you type, and nothing is sent to a server. If you need the reverse, Markdown to HTML turns markdown back into clean or styled HTML.

Why use this HTML to Markdown tool

GitHub Flavored Markdown

Tables, task lists, strikethrough and fenced code blocks are supported.

Choose your style

ATX (#) or underlined headings, - or * bullets, fenced or indented code.

Clutter removed

Scripts, styles, navigation and comments are dropped.

Instant and private

Converts as you paste, in your browser.

How to convert HTML to Markdown

  1. Paste HTML code into the box, or open an .html file.
  2. Pick heading and list styles if you like.
  3. Copy the markdown or download a .md file.

Common uses for an HTML to Markdown converter

Frequently asked questions

Can I convert a web page?

Copy the part of the page you want and use Paste to Markdown, or paste the page's HTML source here.

Are tables supported?

Yes, HTML tables become markdown tables with a header row.

What about inline styles?

Styling such as colours and fonts has no markdown equivalent, so it is left out; bold, italic and links are kept.

Can I convert a whole web page by its address?

This tool works on HTML you paste or open as a file. To convert a live page from its link, use URL to Markdown, which fetches the page and keeps the main content without menus and footers.

Is the HTML to Markdown converter free and private?

Yes. It is free, needs no account, and the conversion runs in your browser, so your HTML is never uploaded. You can also open a saved .html or .htm file with Open file or drag it onto the box. It works on a phone too, although pasting long code is easier on a computer.

What happens to HTML that has no markdown equivalent?

Layout elements such as <div> and <span> are unwrapped and their text is kept. Forms, scripts and styles are removed. Relative links and image paths are kept exactly as written, so check they still point somewhere useful. The result is plain markdown you can edit straight away.

Related markdown tools

See all 41 free markdown tools →