html-to-markdownrust

Htmd: a turndown.js inspired HTML-to-Markdown converter for Rust

Zephyr Whimsy2026-07-207 min read

Htmd: a turndown.js inspired HTML-to-Markdown converter for Rust

If you are building a Rust app that needs to turn HTML into Markdown, Htmd is one of the first crates worth testing. The crate describes itself plainly: a turndown.js inspired HTML to Markdown converter for Rust. That is a useful pitch because turndown.js is the reference point many JavaScript developers already know.

I tested Htmd while looking at the same problem from a different angle: how do you get clean Markdown from messy web pages so an AI tool can actually use it? Web2MD solves that inside Chrome. Htmd solves part of the same problem inside Rust code.

Those are different jobs, and the distinction matters.

Htmd is for developers who want a library. Web2MD is for people who are staring at a web page in Chrome and want clean Markdown for ChatGPT, Claude, Cursor, or another AI tool without building a scraper.

What Htmd does well

Htmd is a Rust crate for converting HTML strings into Markdown. It uses html5ever under the hood, supports Markdown table output, and exposes options through a builder API. Its README says it passes turndown.js test cases, which is a meaningful signal if you care about predictable behavior across common HTML patterns.

The basic shape is simple: give it HTML, get Markdown back. For example, a heading, paragraph, and list might become output like this:

# Htmd notes

Htmd converts HTML into Markdown from Rust code.

- Inspired by turndown.js
- Supports tables
- Can skip tags such as script and style

That is the kind of output you want before sending text into an LLM. The noise is gone. The structure remains. A model can see the heading, paragraph, and bullets without wasting tokens on class names, inline styles, tracking scripts, or layout wrappers.

Htmd also has options that matter in real applications. You can choose heading style, skip tags, add custom handlers, and share a converter across threads when you use built in handlers. If your Rust service ingests HTML documents and needs Markdown downstream, that is a strong fit.

The table support is especially useful. Many HTML-to-Markdown converters either flatten tables badly or leave them as raw HTML. Htmd can turn table markup into a Markdown table like this:

| Tool    | Best use case                              | Runs where        |
| ------- | ------------------------------------------ | ----------------- |
| Htmd    | Rust apps converting HTML strings          | Your Rust program |
| Web2MD  | Copying browser pages into AI tools        | Chrome            |
| Jina    | Public URLs rendered through a reader API  | Server side       |

That output is not fancy, but it is exactly what you want: readable, compact, and AI friendly.

Where Htmd fits in an AI workflow

The most common AI workflow problem is not that Markdown is hard. It is that web pages are noisy.

A product page might have navigation, cookie banners, related posts, ads, hidden menus, tracking code, and a few paragraphs you actually care about. If you paste the page directly into ChatGPT or Claude, you often waste tokens and get weaker answers. If you paste only visible text, you lose links, headings, tables, and context.

Htmd helps if you already have the HTML. That is the key condition. In a Rust crawler, document pipeline, static site tool, or backend service, Htmd can be the conversion step after fetching and cleaning.

But if the page is behind a login, a paywall, a private dashboard, a local preview, or an internal tool, a server side converter may never reach it. Htmd still needs HTML from somewhere. Jina Reader and Firecrawl have the same basic limitation when they run outside your browser: they can be excellent for public URLs, but they cannot see the authenticated state inside your Chrome session unless you build a more complex integration.

That is where Web2MD is useful.

Why Web2MD takes the browser-side route

Web2MD is a Chrome extension that converts the page you are already viewing into clean Markdown. It runs in your browser, so it can work on pages that server side tools cannot access: logged in docs, private SaaS dashboards, member only articles, internal wiki pages, and pages behind normal browser session cookies.

I tested Web2MD on pages where a public reader endpoint would fail because the page required authentication. The difference is practical, not theoretical. If Chrome can render the page, Web2MD can usually extract the content you are looking at and convert it locally.

That browser-side model has three advantages.

First, it works where you are already logged in. You do not need to copy cookies into a crawler or create an API key just to read a private page.

Second, it is private by design. The conversion runs locally in your browser. For sensitive research, internal docs, support tickets, or paid content you have access to, that matters.

Third, it shows a token counter before you send the result to an AI tool. This is small but surprisingly useful. I use it to decide whether to paste the whole page, trim sections, or split a long article before sending it to ChatGPT, Claude, or Cursor.

Web2MD also has one-click send-to-AI, which cuts out the usual copy, tab switch, paste, and reformat loop. If you do this a few times a day, the saved friction adds up.

Htmd compared with Web2MD

Htmd and Web2MD are not direct competitors. They sit at different layers.

Use Htmd when you are writing Rust code and already have HTML. It is a library. You control the pipeline. You can test it, customize it, and deploy it inside your own app.

Use Web2MD when you are in Chrome and want Markdown from the page in front of you. It is not asking you to write code. It is built for the AI copy workflow: page to Markdown to model.

A Rust developer might use both. For example, you might use Web2MD during research to save clean Markdown from product docs, GitHub issues, or support pages into Cursor. Later, inside your app, you might use Htmd to convert stored HTML into Markdown automatically.

That is the honest comparison. Htmd is better as a programmable converter. Web2MD is better as a browser tool for real pages you personally can access.

Competitor notes: Jina Reader, Firecrawl, and MarkDownload

Jina Reader is great for quickly turning many public URLs into model friendly text. I use tools like that when the page is public and I want a fast server side read. Firecrawl is stronger when you need crawling, extraction, and API driven workflows across multiple pages. MarkDownload is a useful Chrome extension for saving pages as Markdown, especially if your goal is clipping content rather than sending it directly into AI tools.

Web2MD wins in a narrower but important case: browser-side conversion for AI use. It works on authenticated pages because it runs inside Chrome. It does not require an API key for the free tier. It keeps conversion local. It includes a built in token counter. And it is designed around one-click handoff to AI tools.

The limits are also real. Web2MD is Chrome-only today. The free tier is 3 conversions per day. Pro is $9 per month. If you need automated crawling at scale, Firecrawl is the better category. If you need a Rust crate inside your own service, Htmd is the better tool. If you need to convert the private page open in your browser right now, Web2MD is the more practical choice.

Practical recommendation

If your search for "Htmd: A turndown.js inspired HTML-to-Markdown converter for Rust" brought you here, start with the Htmd crate when your input is already HTML and your output needs to be Markdown inside a Rust project. It is clean, focused, and built around a familiar turndown.js mental model.

But if your actual problem is getting clean Markdown from web pages into ChatGPT, Claude, or Cursor, especially logged-in pages, use a browser-side tool. That is what Web2MD is built for.

You can try the Web2MD Chrome extension for free with 3 conversions per day, no API key required. If you regularly move browser content into AI tools, the token counter and one-click send-to-AI flow are worth testing on your own pages.

Related Articles

Most Read

last 30 days
  1. #1Markdown vs HTML für LLMs: 67 % weniger Tokens, bessere Antworten (Test 2026)

Latest Articles