chardet

chardet: Detect Text Encodings in Python

chardet 7 is a Python library and CLI for detecting text encodings, languages, and MIME types. Its rewritten detection engine supports streaming, encoding filters, and Python 3.10+ without runtime dependencies.

View on GitHub Compare
Stars
2.7k
Forks
320
Stars, last 30 days
+7
Last commit
9 days ago
Contributors
66

Our take

Activeregular commits and releases

Health score

61/100

How it is scored
Activity
77
Community
52
Issues
63
Pull requests
52

+7 stars in the last 30 days

chardet 7 is a capable, actively maintained option for Python projects that need encoding detection and want a familiar API with additional result metadata.

Good fit if

  • Your application runs on Python 3.10 or later and needs a dependency-free encoding detector.
  • You need streaming detection, candidate filtering, or language and MIME type results.
  • You value the permissive 0BSD license and can account for the project’s concentrated contributor base.

Look elsewhere if

  • Your environment cannot use Python 3.10 or later.
  • You need a detector in another language or a solution that does not depend on Python.
  • Your team requires project maintenance to be broadly distributed across contributors.
All health signals
Last commit2026-10-30 (9 days ago)
Commits, last 90 days100+
Releases, last 12 months15 (latest 7.7.0, 2026-10-18)
Contributors66 (top contributor: 85% of commits)
Issues closed, last 90 days7 (typically closed in 2 days)
Pull requests merged, last 90 days34 (typically merged in 1 day)
Project age14 years

Checked on 2026-11-09 with the GitHub API.

Project history

Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.

Selected snapshot

Stars

2,686

Forks

320

Change since Nov 16, 2026: +1 stars·+1 forks

Overview

chardet 7 is a Python character encoding detector, distributed as both a library and the chardetect command-line tool. Its ground-up rewrite uses a staged detection pipeline, including byte validation and statistical models, to help applications interpret text when its encoding is unknown. It requires Python 3.10 or later and has no runtime dependencies.

The package preserves the public API familiar to users of chardet 5.x and 6.x, while adding language and MIME type results. It is intended for Python programs and command-line workflows that need to inspect text files, streams, or binary data without choosing an encoding in advance.

Key Features

  • Detect encodings with detect() or retrieve ranked candidates with detect_all().
  • Feed input incrementally with UniversalDetector for files and streams.
  • Return language and MIME type alongside detection results.
  • Limit candidates by encoding era or by including and excluding specific encodings.
  • Use the chardetect CLI on files or piped standard input.
  • Optionally use compiled builds for additional performance on supported installations.
  • Call detect() and detect_all() concurrently, including on free-threaded Python.

Use Cases

  • Python applications importing user-supplied text files with unknown encodings.
  • Data-processing pipelines that need to identify encodings before decoding batches of documents.
  • Network or file-processing tools that inspect large inputs incrementally rather than loading them all at once.
  • Developers checking files or standard input from a shell with the chardetect command.
  • Tools that need a likely language or MIME type as well as an encoding estimate.

What you need

Detected in the repository

  • Python >=3.10 (from pyproject.toml)
  • A test suite and automated checks on GitHub Actions

License in plain words

0BSDpublic-domain-like

  • Commercial use: yes
  • Modify and redistribute: yes
  • You must keep: nothing
  • Share your changes: no

A summary, not legal advice: the LICENSE file is what applies.

Getting Started

Install from PyPI:

pip install chardet

See the README for usage examples and the documentation for details.

Considerations

The project is active, with regular commits and releases, and reports quick median times for closing issues and merging pull requests. However, most contributions come from one person, which creates a project continuity risk despite the broader contributor count. Detection results are estimates, so applications should handle ambiguous or low-confidence cases according to their needs. The README documents Python support starting at 3.10; it does not list a non-Python implementation.

Found this useful?

Share it with someone who would like chardet.