Wapgee Logowapgee

Tools / HTML to Markdown

HTML to Markdown

Turn any web page into clean, readable Markdown. Paste your HTML or fetch a URL, strip out the scripts and styles, and download GitHub-flavored Markdown that is ready for docs, notes, or LLM context.

Going the other way? Markdown to HTML →
HTML
-
Markdown (GFM)
-

Why turn HTML into Markdown at all

A web page carries far more than its words: navigation, cookie banners, tracking scripts, inline styles, and layout wrappers that exist only for the browser. Markdown keeps the structure a reader cares about, meaning headings, paragraphs, lists, links, code, and tables, and drops the rest. The result is smaller, readable in any text editor, easy to version in git, and much cheaper to hand to a language model as context.

Typical jobs: archiving a blog post or documentation page as a .md file, migrating content from an old CMS into a static site, turning an API reference into a README section, or preparing a page as clean input for a summarisation prompt.

Paste the HTML or fetch a URL

There are two ways in. Paste mode takes raw HTML from your clipboard, which is the right choice for anything private: a draft from your CMS, an internal wiki page, or an email template. The conversion runs entirely in your browser, so the HTML never leaves your machine.

Fetch mode takes a public URL and retrieves the page for you, because most sites block direct browser requests from another origin (CORS). Only the download goes through the fetch step; the conversion itself still happens client-side. Use it for public docs and articles, and paste mode for everything else.

What stripping scripts and styles removes

With the strip option on, script, style, noscript, iframe, and similar elements are removed before conversion. Without it, the text inside those tags, such as a JSON blob of analytics config or a chunk of CSS, would be carried into the Markdown as literal text. Leave it on unless you specifically need the contents of those tags preserved.

The link and image options decide whether anchors become [text](url) or just their text, and whether images become ![alt](src) or are dropped. Dropping images and keeping link text is the usual setting when the destination is a language model, where URLs are noise and alt text rarely helps.

A worked example

HTML
<article>
  <h2>Install</h2>
  <p>Run <code>npm i showdown</code>, then
  see the <a href="/docs">docs</a>.</p>
  <ul>
    <li>Node 18+</li>
    <li>No build step</li>
  </ul>
</article>
Markdown
## Install

Run `npm i showdown`, then see the [docs](/docs).

* Node 18+
* No build step

Headings map to ATX # headings, inline code keeps its backticks, and lists become bullet lists. Tables convert to GitHub-Flavored Markdown pipe tables, and pre blocks become fenced code blocks. Deeply nested layout divs simply disappear, which is usually what you want.

Each pane has a footer with its line and character counts, and the Markdown side also reports how much smaller it is than the source HTML. When the output looks right, copy it to the clipboard or download it as a .md file.

Front matter for static site pipelines

Turn on include front matter and the output starts with a YAML block containing the page title, the meta description when the source has one, the source URL if you fetched it, and a converted timestamp:

---
title: "Getting started"
description: "Install and run in five minutes."
source: https://example.com/docs/getting-started
converted: 2026-09-12T10:41:00Z
---

Hugo, Jekyll, Astro, Docusaurus, and Obsidian all read that block, so a fetched page can drop straight into a content folder without hand-editing.

Preparing pages as LLM context

Markdown is the most token-efficient way to give a model a web page. The pane footer shows how much smaller the Markdown is than the source HTML; for a typical documentation page the reduction is between 70 and 90 percent, because markup, scripts, and styling are most of the bytes. Fewer tokens means lower cost, more room in the context window, and less irrelevant text for the model to weigh.

To see what a converted page will cost before you send it, paste the Markdown into the token counter. If you need to go back the other way, for example to publish notes written in Markdown, use Markdown to HTML.

What does not survive the trip

  • Layout: columns, floats, and anything positioned with CSS is flattened into reading order.
  • Tables: this converter keeps them as HTML rather than guessing at a grid. For a real GFM pipe table (or CSV) from a table with merged cells, headers and links, use the dedicated HTML Table to Markdown / CSV converter.
  • Content rendered by JavaScript after page load: fetch mode sees the HTML the server sent, not the DOM a browser builds. For app-like pages, open the page, copy the rendered HTML from developer tools, and use paste mode.
  • Inline colour, font, and size styling, which Markdown has no syntax for.

FAQ

Does the conversion run in my browser?

Yes. Showdown runs entirely in your browser, so pasted HTML is never uploaded for conversion. Fetch-from-URL only retrieves the remote page so CORS does not block public docs; the convert step still happens client-side.

What Markdown flavor do you emit?

GitHub Flavored Markdown (GFM): ATX headings, fenced code, tables, and strikethrough via the Showdown reverse converter.

When should I strip scripts and styles?

Keep it on for docs and LLM context. It removes script, style, noscript, iframe, and similar chrome so the Markdown stays readable. Turn it off only if you intentionally need those tags preserved as text.

What does include front matter do?

Prepends a YAML block with title, description (from meta tags when present), optional source URL, and a converted timestamp. Handy for static-site docs pipelines.