---
title: "HTML to Markdown Converters Compared · Mdream"
description: "Compare HTML to Markdown converters: mdream vs Turndown vs node-html-markdown. Benchmarks, token output, features, and npm package size. Find the best converter for your project."
canonical_url: "https://mdream.dev/tools/compare"
meta:
  "og:description": "mdream vs Turndown vs node-html-markdown: speed benchmarks, token comparison, and feature matrix."
  "og:image": "https://mdream.dev/_og/s/o_ae07ee07921f85b7.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "HTML to Markdown Converters Compared"
  "twitter:image": "https://mdream.dev/_og/s/o_ae07ee07921f85b7.png"
---

> Index of every page on this site: [llms.txt](https://mdream.dev/llms.txt)

[Home](https://mdream.dev/)

# **HTML to Markdown Converters Compared **

How does mdream stack up against [Turndown](https://github.com/mixmark-io/turndown), [node-html-markdown](https://github.com/crosstype/node-html-markdown), and [html-to-markdown](https://github.com/johanneskaufmann/html-to-markdown)? Speed benchmarks, token output, and features at a glance.

## Speed Benchmarks

166 KB HTML · lower is better

mdream (Rust)

mdream (NAPI)

mdream (JS)

Turndown (JS)

node-html-md (JS)

[Run live benchmarks in your browser](https://mdream.dev/tools/benchmarks)

## Feature Comparison

HTML to Markdown converter feature comparison

| Feature | mdream | Turndown | node-html-markdown | html-to-markdown (Go) |
| --- | --- | --- | --- | --- |
| Language | Rust + JS + WASM | JavaScript | JavaScript | Go |
| Speed (166KB) | **0.34ms (Rust), 3.26ms (JS)** | 11.26ms | 14.31ms | \~2ms |
| Token Output | **Lowest** | High | High | Medium |
| Bundle Size | 32.6kB (JS), 126.8kB (WASM) | \~30kB | \~25kB | Go binary |
| Streaming |  |  |  | |
| Dependencies | 0 | 1 | 3 | 0 |
| Maintained |  |  |  | |

## mdream

The fastest HTML to Markdown converter in any runtime. Built in Rust with bindings for Node.js (NAPI), browsers (WASM), and a pure JavaScript fallback. Designed for LLM pipelines where token efficiency and speed matter.

[GitHub](https://github.com/harlan-zw/mdream) [ npm](https://npmx.dev/package/mdream)

## Turndown

The most popular HTML to Markdown converter for JavaScript. Turndown has a clean plugin API and good browser support, but is [no longer actively maintained](https://github.com/mixmark-io/turndown). At 11.26ms for 166kB HTML, it is 3.4x slower than mdream's JS engine. On the same fixture, mdream minimal output uses 38% fewer tokens.

## node-html-markdown

A Node.js focused converter with custom translation rules. Actively maintained but the slowest JavaScript option at 14.31ms for 166KB HTML. Produces similar token counts to Turndown. Best suited for Node.js projects that need custom element handling.

## html-to-markdown (Go)

A well-regarded Go implementation by Johannes Kaufmann. Fast at \~2ms, good structure preservation, but only available as a Go module. If your stack is Go, this is a solid choice alongside mdream's Rust crate.

## Frequently Asked Questions

mdream is the fastest HTML to Markdown converter across all runtimes. The Rust implementation processes 166kB of HTML in 0.34ms. The pure JavaScript version runs in 3.26ms, compared with Turndown at 11.26ms.

mdream is the recommended Turndown alternative. On the 166kB benchmark fixture, it produces 38% fewer tokens and its Rust engine is 33x faster. It has zero dependencies and supports streaming for large documents.

On the real 166kB Wikipedia fixture, mdream minimal output uses 38% fewer o200k\_base tokens than Turndown. This matters for LLM context windows where every token counts.

mdream has a different API than Turndown, but covers the same use cases. Migration is straightforward: replace the Turndown import with mdream, pass your HTML string, and get Markdown back. mdream also supports options like minimal mode, table handling, and custom element filtering.

mdream is designed specifically for LLM pipelines. It strips unnecessary whitespace, removes redundant formatting, and produces token-efficient Markdown. It also supports streaming for processing large documents without loading everything into memory, and includes a crawler for generating llms.txt files.

Yes. mdream runs everywhere: Node.js (via Rust NAPI), browsers (via WASM or pure JS), edge runtimes (Cloudflare Workers, Deno, Bun), and as a Rust crate. The pure JS core is 32.6kB gzipped with zero dependencies.

## Try It

[<h3>**Online Converter **</h3>Convert HTML to Markdown in your browser.](https://mdream.dev/) [<h3>**Live Benchmarks **</h3>Run speed tests in your own browser.](https://mdream.dev/tools/benchmarks)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://mdream.dev/#website","@type":"WebSite","description":"Convert HTML to Markdown online. 33x faster than Turndown, 38% fewer tokens. Free, zero dependencies, LLM optimized. Available as npm package, Rust crate, WASM, and CLI.","name":"mdream","url":"https://mdream.dev/","publisher":{"@id":"https://mdream.dev/#identity"}},{"@id":"https://mdream.dev/tools/compare#webpage","@type":"WebPage","description":"Compare HTML to Markdown converters: mdream, Turndown, node-html-markdown, and html-to-markdown. Benchmarks, token efficiency, features, and compatibility.","name":"HTML to Markdown Converters Compared","url":"https://mdream.dev/tools/compare","breadcrumb":{"@id":"https://mdream.dev/tools/compare#breadcrumb"},"isPartOf":{"@id":"https://mdream.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://mdream.dev/tools/compare"]}],"primaryImageOfPage":{"@id":"https://mdream.dev/#logo"}},{"@id":"https://mdream.dev/#identity","@type":"Organization","name":"Mdream","url":"https://mdream.dev","logo":{"@id":"https://mdream.dev/#logo"}},{"@id":"https://mdream.dev/tools/compare#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://mdream.dev","position":1},{"@type":"ListItem","name":"Compare","position":2}]},{"@id":"https://mdream.dev/tools/compare#/schema/question/1","@type":"Question","inLanguage":"en","name":"What is the fastest HTML to Markdown converter?","acceptedAnswer":{"@type":"Answer","text":"mdream is the fastest HTML to Markdown converter across all runtimes. The Rust implementation processes 166kB of HTML in 0.34ms. The pure JavaScript version runs in 3.26ms, compared with Turndown at 11.26ms."}},{"@id":"https://mdream.dev/tools/compare#/schema/question/2","@type":"Question","inLanguage":"en","name":"What is the best alternative to Turndown?","acceptedAnswer":{"@type":"Answer","text":"mdream is the recommended Turndown alternative. On the 166kB benchmark fixture, it produces 38% fewer tokens and its Rust engine is 33x faster. It has zero dependencies and supports streaming for large documents."}},{"@id":"https://mdream.dev/tools/compare#/schema/question/3","@type":"Question","inLanguage":"en","name":"Which HTML to Markdown converter produces the fewest tokens?","acceptedAnswer":{"@type":"Answer","text":"On the real 166kB Wikipedia fixture, mdream minimal output uses 38% fewer o200k_base tokens than Turndown. This matters for LLM context windows where every token counts."}},{"@id":"https://mdream.dev/tools/compare#/schema/question/4","@type":"Question","inLanguage":"en","name":"Can I use mdream as a drop-in replacement for Turndown?","acceptedAnswer":{"@type":"Answer","text":"mdream has a different API than Turndown, but covers the same use cases. Migration is straightforward: replace the Turndown import with mdream, pass your HTML string, and get Markdown back. mdream also supports options like minimal mode, table handling, and custom element filtering."}},{"@id":"https://mdream.dev/tools/compare#/schema/question/5","@type":"Question","inLanguage":"en","name":"Which converter works best for LLM and AI pipelines?","acceptedAnswer":{"@type":"Answer","text":"mdream is designed specifically for LLM pipelines. It strips unnecessary whitespace, removes redundant formatting, and produces token-efficient Markdown. It also supports streaming for processing large documents without loading everything into memory, and includes a crawler for generating llms.txt files."}},{"@id":"https://mdream.dev/tools/compare#/schema/question/6","@type":"Question","inLanguage":"en","name":"Does mdream work in the browser?","acceptedAnswer":{"@type":"Answer","text":"Yes. mdream runs everywhere: Node.js (via Rust NAPI), browsers (via WASM or pure JS), edge runtimes (Cloudflare Workers, Deno, Bun), and as a Rust crate. The pure JS core is 32.6kB gzipped with zero dependencies."}},{"@id":"https://mdream.dev/#logo","@type":"ImageObject","caption":"Mdream","contentUrl":"https://mdream.dev/logo.svg","inLanguage":"en","url":"https://mdream.dev/logo.svg"}]}
```

## Sitemap

See the full [sitemap](https://mdream.dev/sitemap.md) for all pages.
