HTML To Markdown Converter Online

Convert HTML code to clean Markdown online. Paste your HTML, generate Markdown instantly, and use the result for documentation, README files, blogs, or content migration.

A whole page, a fragment or formatted text copied from a web page, Word or Google Docs. Headings, paragraphs, emphasis, links and images, nested lists and task lists, tables, code blocks with their language, blockquotes and line breaks become Markdown; scripts, styles and hidden elements are left out. The Markdown follows CommonMark with the GitHub extras. Have a web address instead of its code? Source Code Downloader fetches the HTML of a page.

Makes relative links and images absolute. Filled in from the page itself when it names its address.

Worth a look

Rate this tool

How useful was this tool?

HTML to Markdown Converter

Paste HTML into the box, load the Example, or Open a file up to 10 MB (you can also drag it onto the page). It can be a whole page, a fragment, or formatted text copied straight from a web page, Word or Google Docs. Paste formatted text and it arrives as its HTML and converts immediately.

The Markdown tab shows the result with syntax colours, and Preview renders it back so you can check it. Under the result you’ll see counts of words, headings, links, images, tables and code blocks, plus the size. Copy the Markdown or Download .md. The download is named after the file you opened, or after the page title.

The conversion runs in your browser. Nothing you paste or open is uploaded.

Example: a whole page

<!DOCTYPE html>
<html>
<head>
  <title>Brewing green tea</title>
  <link rel="canonical" href="https://example.com/guides/green-tea">
</head>
<body>
  <nav><a href="/">Home</a> <a href="/shop">Shop</a></nav>
  <main>
    <h1>Brewing green tea</h1>
    <p>Use water at <strong>70–80 °C</strong>, not boiling. See our <a href="/guides/water">water guide</a>.</p>
    <img src="/img/teapot.jpg" alt="A glass teapot">
    <h2>What you need</h2>
    <ul>
      <li>2 g of tea per 100 ml</li>
      <li>A timer</li>
    </ul>
  </main>
  <footer>© 2026 Example Tea</footer>
</body>
</html>

becomes:

# Brewing green tea

Use water at **70–80 °C**, not boiling. See our [water guide](https://example.com/guides/water).

![A glass teapot](https://example.com/img/teapot.jpg)

## What you need

- 2 g of tea per 100 ml
- A timer

What happened:

  • The navigation and footer were skipped, because Main content only converts just the <main> element. A note lists what was left out.
  • The page address was filled in from the canonical link, so the relative link /guides/water and the image /img/teapot.jpg became full addresses that work anywhere.

Main content only

A web page is mostly menus, headers, footers, sidebars, cookie banners and forms around the actual article. With Main content only on (the default), the converter takes the page’s <main> or <article> element and skips the rest, including elements hidden on the page. The note under the result lists everything that was skipped. If the content you want sits outside those elements, switch the option off.

Page address

Links and images on a page usually use relative addresses like /img/teapot.jpg. Those only work on the original site. Enter the Page address and they become absolute, so they still work when the Markdown is used elsewhere.

You often don’t need to type it: the field fills itself in when the page states its own address in a canonical link, a <base> tag or an og:url tag.

Copying from Word and Google Docs

Formatted text from office apps comes with messy HTML underneath, and the converter handles the usual problems:

  • Word lists. Word marks list items as specially styled paragraphs rather than real lists. They come out as proper Markdown lists.
  • Google Docs formatting. Google Docs sets bold and italic with styles rather than tags, and wraps the whole copied text in a bold tag that cancels itself out. Converters that read only the tags lose the real formatting and scatter stray ** markers around the text. This one reads the styles and keeps the formatting you see.
  • Google redirect links. Links copied from Google Docs often go through a google.com/url?q=... redirect. They’re straightened to point at the real address.

Escaping only what needs it

Markdown gives special meaning to characters like *, _ and [, so a converter has to escape them where they’d otherwise change the formatting. Many converters escape every one, just in case. Here’s what a widely used open-source converter makes of a plain sentence:

Rename file\_name\_here, then 5 \* 3 = 15 and \[draft

This converter only escapes characters that Markdown would actually misread. An underscore inside a word, a * between spaces and a lone bracket are left alone:

Rename file_name_here, then 5 * 3 = 15 and [draft

Both show the same in a preview, but the second is much easier to read and edit, which is the whole point of Markdown.

Tables

The converter writes GitHub-style tables, keeping column alignment. Markdown tables are simpler than HTML ones, so some changes are made, each with a note:

  • No header row: Markdown tables must have one, so the first row becomes the header.
  • Merged cells are split, because Markdown can’t merge cells.
  • Paragraphs or lists inside a cell are joined into one line with <br>, since a Markdown table cell can’t span lines.

Options

  • Headings: # Heading, or underlined for levels 1 and 2.
  • Bullets: -, * or +.
  • Code: fenced with triple backticks, keeping the language, or indented by 4 spaces.
  • Emphasis: *italic* and **bold**, or _italic_ and __bold__.
  • Links: inline, [text](address). Or reference style, [text][1] with the addresses listed at the end, which keeps long paragraphs readable.
  • Line breaks: two trailing spaces, or a trailing backslash. The backslash is visible, so it doesn’t get lost when an editor trims spaces.
  • GitHub tables, strikethrough and task lists: on by default. Switch them off for Markdown tools that only understand basic CommonMark.
  • Keep HTML for what Markdown cannot express: superscript, subscript, keyboard keys, highlights, collapsible <details> sections, video and embedded frames.
    • Kept as HTML, they work wherever Markdown allows HTML. GitHub, for example, shows <details>, <sup>, <sub> and <kbd>, but removes <iframe>.
    • Switched off, they’re reduced to their text, or to a link for video and embeds.

Notes worth a look

Under the result, the converter points out anything you might want to check:

  • What was skipped, dropped or hidden
  • Inline styles that Markdown can’t keep
  • Relative addresses when there’s no page address
  • Changes made to tables
  • Which tags were kept as HTML or reduced
  • Links without a usable address
  • Images without alt text or an address
  • Lazy-loaded images, whose real address sits in an attribute like data-src while src holds only a placeholder
  • A page title with no level-1 heading, where you may want to add the title as # heading yourself
  • Plain text or Markdown pasted by mistake. If you meant to go from Markdown to HTML, use Markdown to HTML

What it’s used for

  • Moving a site to a static site generator like Hugo, Jekyll or Astro, which keep pages as Markdown files.
  • Writing documentation and READMEs for GitHub or GitLab from existing web pages.
  • Saving articles as notes in Markdown apps like Obsidian.
  • Giving a web page to an AI assistant. Markdown keeps the structure but drops the markup, so it’s shorter and easier for the assistant to read.

FAQ

Can I paste straight from Word or Google Docs?

Yes. Copy the formatted text and paste it into the box. It arrives as HTML, and lists, bold, italic and links are converted.

Why is part of the page missing?

Main content only skips navigation, headers, footers, sidebars, forms and hidden elements, and the note lists what was skipped. Switch the option off if you need the whole page.

Will the Markdown look the same as the web page?

The structure will be the same: headings, lists, links, tables and images. Colours, fonts and layout come from CSS, which Markdown doesn’t have, so they don’t carry over.

Can I convert the Markdown back to HTML?

Yes, with Markdown to HTML. To strip HTML down to plain text instead, use the HTML Tags Stripper.

Is my HTML uploaded anywhere?

No. Everything happens in your browser, and nothing you paste or open is stored.

Note: All processing is done client-side. We do not store or see your data.

Contact

Missing something?

Feel free to request missing tools or give some feedback using our contact form.

Contact Us