HTML to Markdown

Paste HTML source, or copy part of a web page and paste it here, and get Markdown you can drop into a README, a wiki or a notes app.

How it works

Your browser's own HTML parser reads the input, through DOMParser. It builds the page structure without running any script or loading any image, and it handles unclosed tags and entities the same way the browser would.

The tool then walks that structure and writes Markdown: # headings, **bold**, *italic*, `code`, links, images, nested lists, quotes, fenced code blocks with their language, and GitHub tables.

Text that would accidentally become Markdown is escaped. A sentence that starts with "1." or "#", or a word with an underscore in it, gets a backslash so it stays plain text.

How to use it

  1. 1 Paste HTML into the HTML box, or copy part of a web page and paste it there.
  2. 2 Read the Markdown in the box below. It updates as you type.
  3. 3 Copy it, or download it as a .md file.

Good to know

  • When you copy from a web page, the clipboard holds the page's HTML as well as its plain text. Pasting here takes the HTML, so headings and links survive.
  • Tags Markdown has no syntax for, such as <span> or <u>, are dropped and their text is kept.
  • A <pre><code class="language-python"> block becomes a ```python fence, so syntax highlighting still works.
  • Line breaks from <br> become a backslash at the end of the line, which survives editors that strip trailing spaces.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Saving a help page into your own notes as Markdown

Say you found a useful help page with setup steps, and you want it in your notes app, which stores everything as Markdown. Copying the plain text loses the headings and the links. Copying the HTML source gives you a wall of tags. Converting gives you something in between: the structure, without the markup.

Select the part of the page you want, copy it, and paste it into the HTML box. The browser hands this tool the HTML of your selection, not just its text. Suppose the selection was a heading "Set up the printer", a paragraph with a link to "the driver download page", and a numbered list of three steps, the second of which has the code word "lpadmin" in it. The Markdown comes out as "## Set up the printer" (the level matches the page's <h2>), a paragraph with [the driver download page](https://...), and a list numbered 1. 2. 3. with `lpadmin` in backticks.

Some things are escaped on purpose. If the page said "Press * to confirm", the Markdown says "Press \* to confirm", because a bare asterisk could start emphasis. A paragraph that begins "1. Unplug the cable" in the HTML, but is not a list there, becomes "1\. Unplug the cable", so it stays a paragraph. These backslashes look odd in the source, and they vanish when the Markdown is rendered.

Code blocks are kept exactly. A <pre> block keeps every space and line, and if its <code> tag has a class such as language-bash, the fence becomes ```bash. If the code itself contains a ``` line, the fence grows to four backticks so the block does not end early.

The conversion has limits. Markdown has no way to say colour, font size, alignment or merged table cells, so those are lost and only the text remains. Layout tables, used by old sites and many emails to position content, turn into Markdown tables that may look strange. Images keep their address, so an image that only loads while you are signed in to a site will not show in your notes. And input over one million characters is refused rather than freezing the page.

Frequently asked questions

Is it safe to paste HTML that contains scripts?

Yes. The HTML is parsed with DOMParser, which builds an inert document: scripts in it do not run and images in it do not load. <script>, <style>, <iframe> and similar tags are skipped entirely, so they do not appear in the Markdown either.

Which Markdown flavour does it write?

CommonMark, with GitHub tables, ~~strikethrough~~ and task list checkboxes. That is what GitHub, GitLab, most wikis and most notes apps read.

What happens to tables with merged cells?

Markdown tables have no merged cells, so each cell becomes one column in its row and short rows are padded with empty cells. The first row always becomes the header, because a GitHub table must have one. Check complex tables by eye after converting.

Is there a size limit?

Yes, one million characters, which is a very long article with all its markup. The conversion runs on this page, and the limit keeps it well under a second.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.