HTML to Markdown guide
Paste HTML, or paste formatted text straight from Google Docs, Word or a web page, and get GitHub-flavored Markdown with tables, nested lists, fenced code and links. Copy or download a .md file.
The real use case: rich text to Markdown
Most people land here with a Google Doc, a Notion page, a Confluence article or an email and need it in Markdown for a README, a static site, a docs repo or a CMS. Copying gives you HTML on the clipboard, whether you see it or not. Paste into the rich text box at the top of the tool and it reads that hidden text/html flavor, drops it into the HTML box so you can see what the source really looked like, and converts it.
If you already have raw HTML, from View Source, an export or an old blog, paste it straight into the HTML box. Output updates as you type.
How the converter works
It hands your HTML to the browser's own DOMParser, which builds an inert document tree. Inert matters: scripts do not run, images are not fetched, and malformed HTML gets repaired exactly the way a browser would repair it. Then the tool walks the tree and emits Markdown for each element. No library, no server.
Headings become # lines, or underlined === and --- for h1 and h2 if you prefer setext. Paragraphs get blank lines between them. strong and b become **bold**, em and i become *italic*, del and s become ~~strikethrough~~. Links become [text](url "title") or numbered references if you pick reference style, which keeps long URLs out of the prose. Images become . Nested lists are indented under their parent item, ordered lists keep their start number, and task-list checkboxes become [ ] and [x]. pre blocks become fenced code with the language picked up from a language-xxx class, and tables become GitHub-flavored pipe tables with alignment from align or text-align.
The Google Docs problem, handled
Google Docs does not use strong or em. It wraps the entire paste in a b tag with font-weight: normal, then marks real bold text with span style="font-weight:700" and italics with font-style:italic. Naive converters turn the whole document bold, or lose all formatting. This one reads those inline styles: font-weight 600 and up means bold, italic means italic, line-through means strikethrough, and a monospace font family means inline code. The fake outer b tag is recognized and ignored.
A worked example
The sample on load has a nested list, a code block, a table and a link with a title. Look at the nested list item: New `--watch` flag, then an indented - Works with `npm run dev`. The sub-list is indented by the width of the parent marker so every Markdown renderer nests it correctly. The table header Price has align="right", so its separator becomes ---: and GitHub right-aligns the column.
Special characters in plain text get escaped. An asterisk in a sentence becomes \*, and underscores in snake_case become \_, so they stay literal instead of turning into emphasis. Text inside code spans and code blocks is left alone, because escapes are not processed there.
What Markdown cannot hold
Markdown is deliberately small. Colors, fonts, font sizes, underline, text alignment, merged table cells and multi-paragraph table cells have no Markdown equivalent, so they are dropped or flattened. A table cell with a list in it becomes a single line. If you need those, keep the HTML: most Markdown renderers, GitHub included, allow raw HTML blocks.
Forms, buttons, iframes, scripts and styles are removed entirely. Navigation menus and footers from a whole web page come through as lists and links, so copy only the article body when converting a page.
Pitfalls
Line breaks. A br tag becomes two trailing spaces and a newline, the CommonMark hard break. Some editors strip trailing whitespace on save and silently merge your lines. If that bites you, replace them with a backslash at line end, which CommonMark also accepts.
Relative links and images. src="/img/chart.png" stays relative. That works if the Markdown lives on the same site, and breaks in a README on GitHub. Find and replace the base URL after converting.
Word-heavy pastes. Microsoft Word HTML is famously noisy: conditional comments, mso- styles, empty spans. The converter ignores the noise, but check list numbering, which Word sometimes fakes with plain paragraphs and typed numbers rather than real lists.
Nothing you paste is uploaded. Internal docs and draft posts stay in your browser tab.
How we calculate: sources
Frequently asked questions
How do I convert a Google Doc to Markdown?
Select the text in Google Docs, copy it, and paste it into the rich text box at the top. The tool reads the formatting from the clipboard and converts it, bold and italics included.
Does it support tables?
Yes. HTML tables become GitHub-flavored Markdown pipe tables, with column alignment taken from align or text-align on the first row.
What Markdown flavor does it output?
CommonMark with GitHub-flavored extensions: pipe tables, ~~strikethrough~~, task list checkboxes and fenced code blocks with the language name.
What HTML cannot be converted?
Colors, fonts, underline, merged table cells and layout have no Markdown equivalent and are dropped. Scripts, styles, forms and iframes are removed.
Is pasted HTML safe?
Yes. It is parsed with the browser's DOMParser into an inert document, so scripts never run and images are not loaded.
Can I use reference-style links?
Yes. Switch Links to Reference and URLs are moved to a numbered list at the end, which keeps long URLs out of your text.
Is my content uploaded?
Everything runs in your browser. Nothing you enter is uploaded to a server or stored by us.