# man > chardetect(1)

---
type: CommandReference
command: chardet
mode: man
section: 1
source: man-pages
---

## Quick Reference

- `chardet file.txt` — detect encoding of a single file
- `chardet file1.txt file2.txt` — detect encoding of multiple files
- `cat file.txt | chardet` — detect encoding of stdin
- `chardet` — (no arguments) reads from stdin

## Name

chardet — universal character encoding detector

## Synopsis

**chardet** [*file* ...]

## Description

Reports heuristically-detected character encoding for each file. For every specified file (defaults to stdin if no files are specified), reads and determines the character encoding of the file content. Reports the name and confidence level for each file's detected character encoding.

## Options

None documented.

## Examples

Detect encoding of a file:

shell
chardet input.txt
Detect encoding of multiple files:

shell
chardet file1.txt file2.txt file3.txt
Detect encoding from stdin:

shell
cat document.txt | chardet
## See Also

- `/usr/share/doc/python-chardet-doc/index.html` (local documentation)
- [CHARDET(1) on phpMan](https://www.chedong.com/phpMan.php/man/CHARDET/1/markdown)