File Token Counter

Count tokens across text, JSON, Markdown, CSV, and code files without uploading their contents.

Drop text or code files hereorUp to 20 files, 2 MB each. PDF, Word, images, and archives are not supported.
Choose one or more files to begin.

Your files stay in this browser. StackLens reads and tokenizes them locally.

Paste text

Count a prompt instead

Use the main tokenizer when you need to inspect and edit one piece of text directly.

FAQ

File token counter questions

Are files uploaded to StackLens?

No. Supported text and code files are read and tokenized locally in your browser. File contents and file names are not sent to StackLens.

Which file types can I count?

The first version supports plain text, Markdown, JSON, JSONL, CSV, HTML, XML, YAML, and common programming-language source files. Each file must be no larger than 2 MB.

Can I count tokens in multiple files?

Yes. Add up to 20 supported files and the table will show each file count plus combined characters, size, and tokens.

Why are PDF and Word files not supported?

PDF and Word documents require text extraction before tokenization. Extraction order, headers, tables, and scanned pages can change the text, so StackLens does not treat those binary files as plain text.

Does this include chat templates or API formatting?

No. The tool counts the decoded file text. Provider chat templates, system messages, tool schemas, media, and other request fields can add tokens.