HTML Tidy is the original open-source HTML cleanup tool, maintained by HTACG, that parses HTML and outputs corrected, standards-compliant markup, with the LibTidy C library at its core.
What is HTML Tidy?
HTML Tidy is a free, open-source command-line tool and C library for correcting and cleaning up HTML markup. It takes malformed or legacy HTML as input and produces tidy, modern HTML, XHTML, or XML as output. The project is hosted on GitHub as htacg/tidy-html5 and has been canonical since 2015-01-15, after transferring from the W3C repository.
Key Features
- Modern standard support — Described as "the granddaddy of HTML tools, with support for modern standards," it handles both legacy and current HTML.
- LibTidy library — A C library for programmatic HTML cleaning; API documentation and quick reference are at api.html-tidy.org.
- Localization — Tidy supports translation into various languages via guides in README/LOCALIZE.md and localize/README.md.
- Extensible configuration — New configuration options can be added by following README/OPTIONS.md.
- Custom messages — Developers can add new diagnostic messages according to README/MESSAGE.md.
- Element and attribute extension — Guides in README/ATTRIBUTES.md and README/TAGS.md explain how to add new attributes and tags.
- Binary distribution — Pre-built binaries are available at binaries.html-tidy.org.
- Regression testing — Contributions must pass existing regression tests; new features require new tests per README/TESTING.md.
Who is it for?
HTML Tidy is for web developers cleaning up legacy HTML, software engineers embedding HTML correction via LibTidy, and translators localizing Tidy's messages. It is also for maintainers who want to extend the tool with new tags, attributes, or configuration options.
What can you do with HTML Tidy?
- Web developers: Automatically fix malformed HTML in old sites to bring them up to current standards.
- Content managers: Convert HTML documents to XHTML or XML for archival or processing.
- Tool builders: Use LibTidy as a library in your own applications to sanitize generated HTML.
- Localizers: Add new language translations for Tidy's diagnostic messages.
How does HTML Tidy work?
HTML Tidy is built from source following the instructions in README/BUILD.md, which cover platform-specific builds. Once compiled, you run the tidy command on an HTML file; it parses the markup, reports errors, and outputs a cleaned version. The project includes detailed developer guides for adding features, ensuring the tool remains extensible.
Pricing
HTML Tidy is free and open source software with a permissive license, as stated in README/LICENSE.md.
FAQ
Is HTML Tidy free?
Yes, HTML Tidy is free and open source software with a permissive license. The full license text is in README/LICENSE.md.
How do I contribute to HTML Tidy?
Start with README/CONTRIBUTING.md for general guidelines, and follow the source code style in README/CODESTYLE.md. Pull requests must pass all existing regression tests, and new features require adding new tests.
How do I build HTML Tidy from source?
Build instructions are in README/BUILD.md. The source is available on GitHub, and pre-built binaries for various platforms can be downloaded from binaries.html-tidy.org.
What is the LibTidy API?
The LibTidy API documentation and a quick reference are hosted at api.html-tidy.org. This covers the C library interface for programmatic use.
What branches and versions are available?
The repository has multiple branches; README/BRANCHES.md explains which branch to use, and README/VERSION.md explains the version numbering scheme.








