HTML to Markdown Converter – Free, Online, Private
Convert a fragment of HTML into Markdown: headings, links, lists, emphasis, code, tables and images.
How to convert HTML to Markdown
- Paste an HTML fragment. A full document's body content works too.
- Read the Markdown. Tags this subset understands are translated and the rest are unwrapped.
- Copy it into a repo. Review anything that used layout tables or inline styles.
Which tags translate
Headings h1 through h6 become the matching number of hashes. p and div become paragraphs. strong and b become double asterisks, em and i single asterisks. A link becomes [text](href). An image becomes . ul and ol become dash lists and numbered lists. blockquote is prefixed with >. pre becomes a fenced code block, and a language- class on a nested code element is kept as the fence info string. A table becomes a pipe table using the first row as the header. br is a newline. hr is a thematic break. Comments are dropped.
What is dropped on purpose
Style attributes, class names other than the code language, and script or style element contents are not turned into Markdown features. Script text that appears as a text node can still show up, so delete script tags before you paste a whole page. Layout that depended on divs and flexbox becomes linear paragraphs. That is a feature when you are extracting an article and a bug when the page was an application shell. Inline SVG is not redrawn. Entities such as & are decoded. The converter is a practical subset, not a browser.
Worked example
The sample article's h1 becomes a level-one heading. The paragraph keeps world in bold and the guide as a link to https://example.com. The ul becomes a dash list of One and Two. There is a blank line between blocks so a Markdown renderer does not glue the list to the paragraph. If the anchor had no href it would keep the text only. If you paste a CMS export full of spans, those spans disappear and the words remain, which is usually the cleanup you wanted.
Round trip
Markdown to HTML on the sibling page will not reproduce the original tags. Strong might come back as strong, a list as ul, and a div will be gone. Do not use the pair as a lossless archive of HTML. Use it to move an article into a repository that stores Markdown. The work is local. A draft that is not public yet does not need to be posted to an online converter.
Frequently asked questions
Are scripts removed?
Comments are removed. Delete script and style tags yourself before pasting a full page so their text cannot leak into the Markdown.
Do tables work?
A simple tr/th/td table becomes a pipe table. Colspan and rowspan are not represented.
Is the HTML sanitized?
Tags are translated to Markdown text. The output is not fed back through an HTML sanitizer because it is Markdown, not HTML.
Is the fragment uploaded?
No. The translation runs in the browser.