--- id: chardet version: "7.5.1" license: 0BSD license_treatment: permissive maintenance: active --- # chardet — Universal character encoding detector License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install chardet uv add chardet poetry add chardet ## Description # chardet Universal character encoding detector. [![License: 0BSD](https://img.shields.io/badge/License-0BSD-blue.svg)](LICENSE) [![Documentation](https://readthedocs.org/projects/chardet/badge/?version=latest)](https://chardet.readthedocs.io) [![codecov](https://codecov.io/github/chardet/chardet/branch/main/graph/badge.svg?token=m5ZQrMd3vk)](https://codecov.io/github/chardet/chardet) chardet 7 is a ground-up, 0BSD-licensed rewrite of [chardet](https://github.com/chardet/chardet). Same package name, same public API — drop-in replacement for chardet 5.x/6.x, just much faster and more accurate. Python 3.10+, zero runtime dependencies, works on PyPy. [Read more details about the rewrite process.](https://dan-blanchard.github.io/blog/chardet-rewrite-controversy/) ## Why chardet 7? **99.3% accuracy** on 2,517 test files. **134x faster** than chardet 6.0.0, and **+13.9pp more accurate** than charset-normalizer 3.4.9 at 2.6x its speed. **Language detection** for every result. **MIME type detection** for binary files. **0BSD licensed.** | | chardet 7.5.0 (mypyc) | chardet 6.0.0 | [charset-normalizer] 3.4.9 | | ---------------------- |... ## AI interpretation — verify before relying Detects character encoding and language in byte strings with 99.3% accuracy, supporting 99 encodings and 49 languages, plus MIME type identification for binary files. Verdict: A ground-up rewrite offering 134× speed and 11pp accuracy gain over chardet 6, with zero dependencies, active maintenance, and permissive 0BSD licensing. No known vulnerabilities. Suitable for production use where encoding detection is a core need. [View on SkillFed](https://skillfed.io/packages/chardet) · [View on PyPI](https://pypi.org/project/chardet/)