Local LLM Token Counter
Paste a prompt and get exact token counts for GPT-4o, GPT-4, GPT-3.5 and an accurate estimate for Claude. 100% client-side, nothing leaves your browser.
- Exact Tiktoken encodings
- Live character & word counts
- No upload, no sign-up
Loading tokenizer…
- Runs in your browser
- No upload
- No sign-up
- Exact Tiktoken
- Works offline
Related tools
Free AI and developer tools that run in your browser. Nothing uploaded, ever.
Why this tool is the best choice
Most token counters send your text to a server. This one runs locally in your browser.
| Feature | TToolDeck | Tiktokenizer | OpenAI Tokenizer |
|---|---|---|---|
| Runs entirely in your browser | Yes | No | No |
| Prompts never sent to a server | Yes | No | No |
| No sign-up or account | Yes | Yes | No |
| Exact GPT-4o (o200k_base) support | Yes | Partial | No |
| Live character and word counts | Yes | Yes | No |
| Works offline after page loads | Yes | No | No |
How it works
- 1
Paste your text
Paste your system prompt, user message, or entire codebase into the text area.
- 2
Select the model
Choose between GPT-4o, GPT-4, or Claude. We use the exact same Tiktoken encodings as OpenAI.
- 3
View the count
The token count updates live. Check character, word, and token density instantly.
Everything you get for free
Exact OpenAI Encodings
We use the official tiktoken WebAssembly library. The counts for GPT-4o and GPT-4 are identical to what OpenAI charges you.
100% Secure
Your prompts often contain proprietary business logic. Because this runs locally, your data never touches a server.
Claude Support
Anthropic doesn't offer a public browser tokenizer, so we use the closest approximation to give you a highly accurate estimate.
Live Density Metrics
See exactly how many characters and words make up a token, helping you optimize prompts for maximum density.
Zero Latency
Because it runs locally, there is no network round-trip. The count updates as fast as you can type.
No Watermarks or Limits
Count as many tokens as you want, as many times as you want. No daily limits, no account required.
What people use it for
Managing API Budgets
Know exactly how much a prompt will cost before you send it to the OpenAI API.
Optimizing System Prompts
System prompts are sent with every request. Trim them down to save money on every single API call.
RAG Pipelines
Ensure your retrieved context fits within the model's context window before sending the final prompt.
Model Comparisons
See how the same text splits differently between GPT-4o and Claude models.
Token Limit Testing
Ensure a long document will fit inside a 128k context window before attempting to process it.
Educational Purposes
Understand how LLMs "see" text by seeing exactly where the token boundaries fall.
Questions people ask
Are my prompts uploaded to a server?
No. ToolDeck uses the open-source tiktoken library compiled to WebAssembly to run entirely in your browser. Your text never leaves your device.
Which models are supported?
We support exact token counting for OpenAI models (GPT-4o, GPT-4, GPT-3.5) and an accurate approximation for Anthropic Claude models.
Why do Claude tokens say "Approximate"?
Anthropic has not released a public browser-based tokenizer yet. We use the closest equivalent (cl100k_base) which typically gets within a few percentage points.
What is a token?
A token is a chunk of text. It can be a whole word or part of a word. On average, 1 token equals about 4 characters or 0.75 words in English.
Does it handle code and markdown?
Yes. The tool accurately counts tokens for markdown formatting, code blocks, and special characters.
Is there a character limit?
Because the tool runs locally on your machine, the limit is only your device's memory. It easily handles text up to 100,000+ characters.
Can I use this for other LLMs?
Yes, the cl100k_base encoding is used by many models. However, exact counts are only guaranteed for the models listed.
Does this include image tokens?
No, this tool is for text-based tokens only. Vision models calculate image tokens differently based on resolution.