About HTML To Markdown
Paste the HTML of a page, an e-mail or a CMS export, or open an .html file, and get Markdown you can drop into a README, a wiki, a static site or a notes app.
The HTML is cleaned before it is converted: scripts, styles, event handlers, forms and frames are removed, so their contents never end up in your Markdown. Tables become GitHub pipe tables with their column alignment, and struck-through text becomes ~~strikethrough~~.
How it works
- DOMPurify first removes anything that is not content: scripts, styles, event handlers, forms, frames and embedded objects.
- The cleaned HTML is converted by the Turndown library: headings, emphasis, links, images, lists, quotes and code blocks map to their Markdown forms, and Markdown characters in ordinary text are escaped.
- With GitHub Flavored Markdown on, a table becomes a pipe table. Its first row is the header, a cell spanning several columns is followed by empty cells, and line breaks inside a cell become <br>. With it off, tables are kept as HTML.
Questions
What happens to elements Markdown has no syntax for?
Their text is kept and the element itself is dropped, so a <span> or <div> simply disappears around its contents. Tables are the exception when GitHub Flavored Markdown is off: they stay as HTML.
Can it convert a whole web page by its address?
No. It never fetches anything. Open the page, view its source or save it, and paste the HTML or open the saved file here.
Is there a size limit?
Up to 2 MB of HTML at a time, nested no more than 512 elements deep, which covers any ordinary page. Everything runs in your browser.
Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.