This page converts an HTML fragment into Markdown. It handles headings, paragraphs, bold and italic text, links, images, ordered and unordered lists including nested ones, blockquotes, fenced code blocks and simple tables. Paste the markup, choose whether to keep images, and copy the Markdown from the result area.
It works on a fragment rather than a whole page. A full document with head, navigation and scripts will convert, but the scripts and styles are dropped and the layout is flattened. The output is meant for a README, a CMS field or a documentation file, not for preserving a web page pixel for pixel.
What converts cleanly
Each h1 to h6 becomes the matching number of # characters. strong and b become double asterisks, em and i become single asterisks, del, s and strike become double tildes, and code becomes a backtick span. Paragraphs are separated by a blank line, which is how Markdown starts a new block.
Links become [text](url) and images become . A pre containing a code element becomes a fenced block, and a blockquote gets a > prefix on each line. Unordered lists use hyphens, ordered lists use numbers, and a simple table with a header row becomes a pipe table with a separator row.
Entities are decoded where the text survives. & becomes & and " becomes a straight quote. Escaped angle brackets are kept as visible text rather than treated as tags, so <div> in the source becomes <div> in the Markdown. That is usually right for prose, but it means the output is Markdown source, not HTML-escaped text, so a literal asterisk or underscore in the original text may need escaping before it is published.
Images and relative links
Keep images is on by default. Clearing it removes every img element and leaves the surrounding text, which is useful when the destination does not support images or when the alt text is the only part you need. In the sample, dropping the image cut the output from 324 to 249 characters and from 18 to 16 lines.
Mark relative links and images adds an HTML comment beside a relative URL, because Markdown has no base URL and the link will resolve against wherever the file is published. The check covers root-relative paths such as /about.html as well as paths like page.html. A live URL, a mailto: address, a fragment and a protocol-relative // address are left unmarked. The comment sits after the link and before the following punctuation, and a Markdown renderer hides it from the rendered page.
A URL containing parentheses or spaces is wrapped in angle brackets, so https://example.com/a(b) becomes <https://example.com/a(b)> and stays a single destination. That form is the Markdown convention for a destination that the parser could otherwise cut short. A URL with a title becomes [text](url "title").
A worked example
An article of 423 characters containing a heading, two paragraphs, a list, a blockquote, a code block, a link and an image was converted with both options on. The result was 324 characters, 18 lines, 2 headings and 2 links or images.
| Input | Options | Result |
|---|---|---|
| Article with image, 423 characters | Keep images, mark links | 324 characters, 18 lines |
| Same article | Mark links, drop images | 249 characters, 16 lines |
| Table and nested list, 125 characters | Keep images, mark links | 62 characters, 7 lines; both structures kept |
| Escaped tag text, 45 characters | Mark links | 27 characters; <div> kept |
The first output is a fair summary of what the tool does well. The heading became # Free browser tools, the two inline emphases became ** and *, the list became three hyphen lines, and the quote and code block kept their structure. The image became a Markdown image with its alt text.
The table run shows both structures now surviving together. The pipe table keeps its header and separator, and the nested ordered list comes out as 1. One followed by an indented 1. Nested on the next line. A bullet parent indents its child by two spaces and a numbered parent by three, which is the width of the marker it sits under, so the child stays inside the parent item in a CommonMark renderer.
<tag> now stays visible, but a bare <tag> is still treated as markup and removed. Escape code samples in the source, or check the output and fix them by hand.What is flattened or lost
Layout elements have no Markdown equivalent. A div, a grid, a column container or a nested table keeps its text but loses its visual structure. The converter says so in its checklist. That is expected: Markdown describes blocks and inline emphasis, not positioning.
script, style, noscript, template, svg and HTML comments are dropped. A comment that contained an instruction or a marker is not recoverable from the output. Inline styles and classes are dropped too, so a highlighted callout becomes an ordinary paragraph.
A definition list becomes plain paragraphs, and a table whose cells contain lists or several paragraphs is flattened into one pipe row per source row. Footnotes have no equivalent. Very deeply nested markup is flattened into the order the text appears, which is readable but no longer matches the source tree.
Checking the Markdown
Preview the result before publishing. A stray asterisk, an unclosed bracket or a line that begins with # by accident can change the rendering. Links and images are the part most worth re-reading, because a destination that the parser reads differently will fail silently.
For the reverse direction, use the Markdown to HTML converter. If you are moving a whole page, the HTML beautifier will make the source easier to inspect before conversion, and the code diff checker can compare the new Markdown with the old text.