Skip to content

Codebase Tokenizer

Developer Toolsβ€’Client-Side & Private

Upload a codebase ZIP to count LLM tokens per file and in total, and find byte-identical duplicate files with SHA-256 hashing. All local, 20 MB cap.

Tool workspace

Caps (stated honestly): max 20.00 MB total ZIP size, max 500 files. Files are hashed with SHA-256 in your browser β€” byte-identical files are true duplicates, not just same-name files. Token counts use js-tiktoken (cl100k_base) for text files under 1 MB; text files of 1 MB or more are counted with a ~4-chars-per-token estimate and labelled as such. Non-text files are listed with 0 tokens. Nothing is uploaded.

Loading tool controls…

Files processed locally β€” never uploaded to our servers
Free Instant Private

Verify it yourself: press F12, open the Network tab, and use this tool β€” your files are never uploaded.

Codebase Tokenizer at a glance

Price
Free
Account
Not required
File uploads
None β€” your files are never uploaded

Who uses Developer Tools?

Developers and engineers formatting JSON, testing regex, hashing data, encoding values or building API requests.

How to Use Codebase Tokenizer

Follow these simple steps to get instant results in your browser.

1

Zip the Codebase

Zip a project folder (up to 20 MB, 500 files) and upload it.

2

Read the Totals

See file count, total size, total tokens and duplicate groups at a glance.

3

Find the Waste

Open a duplicate group to see every copy, and check the per-file table for the biggest token costs.

πŸ’‘

What is Codebase Tokenizer & How Does It Work?

Codebase Tokenizer answers two questions about a codebase before you send it to an LLM: how many tokens is it, and where are the duplicates? Upload a .zip and the tool lists every file with its size and token count, totals the tokens, and groups byte-identical files by SHA-256 hash.

Token counts use js-tiktoken (cl100k_base) for text files under 1 MB β€” the same tokenizer setup as LLM Token Counter. Text files of 1 MB or more fall back to a ~4-chars-per-token estimate, labelled as an estimate; other files (images, fonts, archives and anything else) are listed with 0 tokens and are not estimated. Duplicates are true byte-identical files, not just same-name files; empty files are not counted.

The caps are stated on the page: 20 MB total ZIP size, 500 files. Split a larger codebase into smaller ZIPs and add the totals. Nothing is uploaded β€” the ZIP is read, hashed and tokenized in your browser.

⚑

Key Features & Capabilities

βœ“

Per-File Token Counts

Every file listed with size and token count, sorted by tokens, with a grand total.

βœ“

SHA-256 Duplicate Detection

Byte-identical files grouped by hash, with the wasted bytes totalled.

βœ“

Labelled Estimates

Text files of 1 MB or more use a ~4-chars-per-token estimate, clearly labelled as an estimate. Non-text files are listed with 0 tokens and are not estimated.

βœ“

Honest Caps

20 MB and 500 files, stated on the page β€” larger codebases split into smaller ZIPs.

βœ“

Private by Design

The ZIP is read, hashed and tokenized in your browser. Nothing is uploaded.

Pro Tips

  • β€’Bookmark this tool for instant one-click access anytime.
  • β€’Drag and drop files directly onto the input surface for fastest handling.
  • β€’All processing happens in your browser session for maximum speed and data safety.

🎯 Common Use Cases

Sizing an LLM UploadCheck whether a codebase fits in a model's context window before pasting it into a chat.
Finding Duplicated FilesDiscover copied config, vendored files or duplicated components hiding in a project.
Budgeting API CostsCount the tokens in a repo to estimate what a code-review or migration job will cost.
Finding Wasted Copies Before a ReviewFind byte-identical copies of a config or component before a code review, and see exactly how many bytes the copies waste.
πŸ“

Codebase Tokenizer - Tokens and Duplicates

Formula Equation:
total tokens = Ξ£ tokens per file (js-tiktoken cl100kbase); wasted bytes = Ξ£ (copies βˆ’ 1) Γ— file size per SHA-256 group

Text files under 1 MB are counted exactly with js-tiktoken; text files of 1 MB or more use a ~4-chars-per-token estimate, labelled as one. Non-text files are listed with 0 tokens and are not estimated. Duplicates are byte-identical files grouped by SHA-256 hash, not just same-name files.

✏️

Worked Example

  1. 1ZIP with 3 files: app.js (46 B, 15 tokens), utils.js (identical copy, 46 B, 15 tokens), README.md (8 B, 3 tokens)
  2. 2Total: 33 tokens Β· 1 duplicate group (same SHA-256) Β· 46 bytes wasted by the copy
  3. 333 = 15 + 15 + 3; wasted = 46 B Γ— (2 copies βˆ’ 1)
πŸ“š

Sources & Further Reading

Frequently Asked Questions about Codebase Tokenizer

Frequently asked questions

With js-tiktoken (cl100k_base) for text files under 1 MB β€” the same tokenizer setup as LLM Token Counter. Text files of 1 MB or more use a ~4-chars-per-token estimate, labelled as an estimate. Non-text files (images, fonts, archives) are listed with 0 tokens β€” the tool does not estimate them.

Every file is hashed with SHA-256 in your browser. Files with identical hashes are byte-identical β€” true duplicates, not just files with the same name. Empty files are not counted as duplicates.

Max 20 MB total ZIP size and max 500 files. Split a larger codebase into smaller ZIPs and add the totals.

No. The ZIP is read, hashed and tokenized entirely in your browser. Nothing is uploaded.

Two files with identical content β€” the same SHA-256 hash. The file names do not matter: app.js and util.js with the same contents are duplicates. Empty files are never counted as duplicates, even though they all hash the same.

Yes. The ZIP is read recursively, and the file list shows each file’s full path, so src/app.js and src/utils.js are listed separately with their own token counts.

Complementary utilities for your workflow

View all β†’
You are here

Codebase Tokenizer

Count LLM tokens and find duplicate files in a ZIP.

Current tool

LLM Token Counter

Count tokens for GPT and Claude models, with cost estimates.

Try tool

JS Formatter

Beautify JavaScript with proper indentation.

Try tool