--- id: html2text version: "2025.4.15" license: GPL-3.0-or-later license_treatment: copyleft maintenance: aging --- # html2text — Turn HTML into equivalent Markdown-structured text. License: copyleft · Maintenance: aging · Downloads: 15.2M/mo ## What it is and what it does html2text is a command-line tool and Python library that transforms HTML into plain ASCII text formatted as valid Markdown. It strips HTML markup while preserving document structure—bold, italic, links, code blocks, and other semantic elements are converted to their Markdown equivalents. The tool offers fine-grained control over output through options like link handling (ignore, reference-style, or inline), special character escaping, and code block marking. The package has zero runtime dependencies and works as both a standalone script (invoked with `html2text [filename]`) and as an importable Python module. It supports modern Python versions (3.9 through 3.13) on CPython and PyPy, making it suitable for integration into text processing pipelines, documentation generators, or any workflow that needs to extract readable content from HTML. Use it for: - Extract readable text from web pages or HTML emails for archival or plain-text distribution. - Convert HTML documentation to Markdown for version control and static site generators. - Batch-process HTML files into text format for downstream NLP or text analysis tasks. - Generate reference-style Markdown from HTML with customizable link formatting. - Strip HTML markup while preserving semantic structure for accessibility or readability tools. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Converts HTML to clean, readable plain text or Markdown-formatted output, with options to customize link handling, escaping, and code block marking. Yes, if you need HTML-to-text or HTML-to-Markdown conversion without external dependencies. The package is stable, widely used (top 5000 on PyPI), and has no known vulnerabilities. The aging maintenance status (last release 486 days ago) is a minor concern for new feature requests but does not block routine use. Avoid if you require active, frequent updates or have strict copyleft license restrictions in your project. ## Install pip install html2text uv add html2text poetry add html2text ## Installing html2text Before you install: Low install friction with no runtime dependencies. Maintenance status is aging—last release was 486 days ago—but the repository remains active and the package is marked Production/Stable with broad Python version support (3.9–3.13). License in practice: Licensed under GPL-3.0-or-later (copyleft). Any software that incorporates or distributes this package must also be released under a compatible copyleft license; proprietary or closed-source projects cannot use it without legal review. Quickstart: pip install html2text import html2text h = html2text.HTML2Text() h.ignore_links = False print(h.handle("
Hello, world!
")) Requires Python 3.9 or later. Verify before relying: - Whether the aging maintenance status (486 days since last release) affects bug fixes or compatibility with newer Python minor versions beyond 3.13. - Performance characteristics on large HTML documents or batch conversion workloads. ## Package facts - License: GPL-3.0-or-later (copyleft) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 15.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags html to markdown conversion, html to plain text, convert html documents, extract text from html, html markdown converter, strip html formatting, html parser text extraction, html-parsing, markdown-generation, text-extraction [View on SkillFed](https://skillfed.io/packages/html2text) · [View on PyPI](https://pypi.org/project/html2text/)