trafilatura vs html2text
Python tools for extracting readable text from HTML
trafilatura and html2text both convert HTML into readable text for downstream workflows. trafilatura focuses on content discovery and structured text with metadata, while html2text focuses on straightforward conversion to Markdown-formatted plain text.

trafilatura: Extract Text and Metadata from Web Pages
Trafilatura is a Python library and CLI for discovering web content and extracting readable text and metadata from HTML. It suits developers and researchers building crawlers, web corpora, or content-processing pipelines that need structured output.

html2text: Convert HTML into Readable Markdown
html2text turns HTML into readable Markdown from Python code or the command line. It suits scripts and applications that need text from web content, with options for handling links and code blocks.
| trafilatura | html2text | |
|---|---|---|
| Language | Python | Python |
| License | Apache-2.0 | GPL-3.0 |
| Stars | 6.9k | 2.2k |
| Forks | 447 | 301 |
| Last analyzed | Oct 3, 2026 | Oct 13, 2026 |
Key differences
- trafilatura can discover URLs from sitemaps and feeds and process live URLs; html2text converts supplied HTML pages or snippets.
- trafilatura extracts metadata and can preserve document structure such as headings, lists, and quotes; html2text outputs Markdown-formatted plain text.
- trafilatura offers TXT, Markdown, CSV, JSON, HTML, XML, and XML-TEI exports; html2text is centered on Markdown-style text.
- trafilatura is licensed under Apache-2.0, while html2text is licensed under GPL-3.0.
- trafilatura supports parallel processing and download queues; html2text provides a configurable Python interface and command-line conversion options.
Choose trafilatura if you…
- need URL discovery, downloading, or crawl support alongside extraction.
- want metadata and structured content for corpora or content-processing pipelines.
- need multiple output formats or parallel processing.
Choose html2text if you…
- want a direct conversion of HTML into readable Markdown-formatted text.
- need a small Python or command-line tool for HTML pages or snippets.
- want options to preserve or omit link formatting in the output.
Compare the numbers side by side, or add more projects
This comparison is generated with AI from the OSRepos analyses of both projects. Always check each project's repository and documentation before choosing.