Convert HTML to markdown
Paste HTML, or text copied straight from a website or a document, and the markdown appears as you type. The page works out which you pasted, and keeps the headings, links, and lists of copied text.
How to use it#
- Paste HTML code, or text copied from a website or a document, into the box. The markdown appears underneath as you type.
- Pick how headings, bullets, and code blocks are written, and whether line breaks are written as they are.
- Copy the markdown, or download it as a .md file.
What comes across, and what does not#
Everything markdown has a way to write comes across: headings, paragraphs, bold and italic, links, images, quotes, ordered and bulleted lists, nested lists, code, and horizontal rules. The GitHub extensions come across too, so a table with a header row becomes a pipe table, struck-through text keeps its double tildes, and a checklist becomes a task list.
Everything else is dropped rather than guessed at. Colours, fonts, classes, and layout have no markdown equivalent, so a styled div becomes its text. Scripts, styles, and the page head are left out entirely, because their contents are not part of what a reader sees. A table without a header row stays as HTML, since markdown tables need one.
Characters that would otherwise be read as markdown are escaped, so a paragraph starting "1. " stays a paragraph instead of becoming a list, and an asterisk in the text stays an asterisk.
Pasting from a web page or a document#
Copying text from a website, a word processor such as Word or Google Docs, or an email copies its formatting as well, as rich text: HTML that the browser carries alongside the plain text. When a paste carries that HTML, it is what goes in the box, so the headings, links, and lists survive into the markdown instead of being flattened. Markdown keeps those in far fewer characters than the HTML, which makes it a common way to paste a web page into an AI chat, or to keep it in a notes app that stores markdown.
The HTML is shown before it is converted, which is useful because it is often not what you expect: word processors in particular wrap everything in spans and styles. Most of that has no markdown form and falls away, but bold, italic, and strikethrough set by a style rather than a tag are kept, which matters for Google Docs, since it marks all three that way. The pasted markup is read in a document of its own that is never shown, so any script in it does not run and any image in it is not fetched.
Choosing the output style#
Markdown allows several ways to write the same thing, and the choice matters when the file goes into a project that already has a style. Headings can be marked with hashes, or underlined with = and - for the first two levels. Bullets can start with a dash, an asterisk, or a plus. Code blocks can be fenced with backticks, which keeps the language name for syntax highlighting, or indented four spaces.
Hashes, dashes, and fenced code are the most widely read, and are what the markdown to HTML converter produces on the way back. Change a setting and the markdown is rewritten straight away.
Frequently asked questions#
Is my HTML uploaded anywhere?
#
No. The conversion happens in this tab, and the markup is parsed into a document that is never displayed, so nothing in it runs or loads. Nothing is sent to a server.
Can I paste straight from a web page or a document?
#
Yes. Copy the part you want from the website, word processor, or email, and paste it into the box. The formatting behind the text goes in as HTML and is converted, so headings, links, and lists come across. HTML code copied from an editor goes in as the code. Code copied along with the page around it, such as a tutorial with its headings, could be either, so it goes in as the code, and the page asks whether to convert that code or the page's own HTML. A paste with no formatting at all, as from a plain text editor, goes in as plain text and the page says so.
Can I convert a web page from its URL?
#
Not from the address alone. Fetching another site's page needs a server, and this page runs only in your browser. Open the page, select the part you want, or all of it with Ctrl+A or Cmd+A, copy it, and paste it here. To convert the full markup instead, right-click the page, choose View Page Source, copy all of it, and paste that.
Can I convert a Google Doc to markdown?
#
Yes. Select the text in the document, copy it, and paste it here. Headings, links, lists, bold, and italic come across. A table stays as HTML, because a table copied from a document has no header row and a markdown table needs one. Images come across as links to wherever the document keeps them rather than as files, so save any you need separately.
How are line breaks written?
#
A line break inside a paragraph, a br tag in HTML, is written as two spaces at the end of the line, which is how standard markdown marks one. Tick line breaks as written to write it as a plain newline instead, which is how GitHub comments and most chat tools read markdown. The markdown to HTML converter has the same setting for the other direction.
Does it convert tables?
#
Yes, into GitHub style pipe tables, as long as the table has a header row. A table without one stays as HTML in the output, because markdown has no way to write a table without a header, and most markdown renderers pass HTML through untouched.
Which flavour of markdown does it write?
#
GitHub Flavored Markdown, the dialect most tools read. Plain CommonMark readers accept everything except the tables, strikethrough, and task lists, which are GitHub extensions.
Why is some of my HTML missing from the markdown?
#
Because markdown has no way to write it. Styling, classes, forms, and layout have no markdown equivalent, so only their text is kept, and scripts and styles are dropped. If you need a piece of HTML kept exactly, paste it into the markdown yourself: markdown allows raw HTML, and the markdown to HTML converter passes it through.