ToolsHub4u

Convert HTML into clean Markdown

Paste HTML and get Markdown with headings, links, images, tables and nested lists. Nested items are indented and relative links are marked.

  • Clean Markdown
  • Scripts removed
  • Runs locally
Ready Developer & Utility
1Enter
2Adjust
3Copy result

HTML to Markdown Converter

1

HTML input

Options

Relative links are kept as written but marked with a comment, because Markdown has no base URL. Turn off keep images to drop them entirely.

No data yet Live
2

Markdown

Converted 423 characters of HTML to 278 characters of Markdown.

Markdown

  • Scripts, styles and comments were droppedThey have no Markdown equivalent and would only add noise to the output.
  • Complex layout is flattenedDivs, grids, columns and nested tables do not map to Markdown. Their text is kept, but the visual structure is not.
  • Relative links are markedA relative href depends on the page it came from. The output adds an HTML comment so you can fix it.
Headings
2
Links and images
2
Lines
18
Characters
278

This is a pragmatic converter, not an HTML parser. It handles articles and documentation fragments well. It does not preserve CSS classes, scripts, embedded media players, footnotes or complex nested lists.

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 ![alt](src). 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. &amp; becomes & and &quot; becomes a straight quote. Escaped angle brackets are kept as visible text rather than treated as tags, so &lt;div&gt; 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.

Conversion results for four inputs
InputOptionsResult
Article with image, 423 charactersKeep images, mark links324 characters, 18 lines
Same articleMark links, drop images249 characters, 16 lines
Table and nested list, 125 charactersKeep images, mark links62 characters, 7 lines; both structures kept
Escaped tag text, 45 charactersMark links27 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.

Check the angle bracketsAn escaped &lt;tag&gt; 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.

Questions

Common questions

Short answers about this tool and its limits.

Does it keep nested lists?

Yes. A child list is rendered under its parent item and indented by the width of the parent marker: two spaces after a bullet, three after a number. 1. One with a child becomes two lines, not one run-together item.

Why does escaped tag text now stay visible?

&lt;div&gt; is decoded after the tag-stripping pass, so it becomes visible <div> instead of disappearing. A bare <div> in the source is still real markup and is still removed with its tags.

Are relative links made absolute?

No. The option marks relative paths with an HTML comment, and it now marks root-relative paths such as /about.html as well as page.html. The tool has no base URL and does not invent one.

Can I drop images?

Yes. Clear Keep images and every img element is removed. The surrounding text stays. In the sample this reduced the output from 324 to 249 characters and from 18 to 16 lines.

Does it convert tables?

Simple tables with a header row become pipe tables, and a table and a nested list can now appear in the same fragment without one breaking the other. A table whose cells contain lists or several paragraphs is flattened into one row per source row.

What happens to scripts and styles?

script, style, noscript, template, svg and HTML comments are dropped. They have no Markdown equivalent and would only add noise. Do not rely on a comment marker surviving the conversion.

What happens to a URL with parentheses?

It is wrapped in angle brackets, so https://example.com/a(b) stays one destination and no stray ) is left in the text. A URL with a title keeps the title after the address.

Is my HTML uploaded?

No. The conversion runs in the browser with no account or server copy. Copy or download the Markdown before closing the tab, because nothing is stored.