LLM Token Counter
Estimate tokens, API cost and context window usage for GPT-4, Claude, Llama and Gemini.
0 characters
0
Characters
0
Words
0
Sentences
0
Paragraphs
GPT-4o
OpenAI
~0
tokens
GPT-4o-mini
OpenAI
~0
tokens
GPT-4o (Jan 2025)
OpenAI
~0
tokens
o1
OpenAI
~0
tokens
o1-mini
OpenAI
~0
tokens
o3-mini
OpenAI
~0
tokens
GPT-4 / GPT-4 Turbo
OpenAI
~0
tokens
GPT-3.5 Turbo
OpenAI
~0
tokens
Claude 3.5 Sonnet
Anthropic
~0
tokens
Claude 3.5 Haiku
Anthropic
~0
tokens
Claude 3 Sonnet
Anthropic
~0
tokens
Claude 3 Haiku
Anthropic
~0
tokens
Claude 4 Opus
Anthropic
~0
tokens
Claude 4 Sonnet
Anthropic
~0
tokens
Claude 3 Opus
Anthropic
~0
tokens
Gemini 2.0 Flash
~0
tokens
Gemini 2.0 Pro
~0
tokens
Gemini 1.5 Pro
~0
tokens
Gemini 1.5 Flash
~0
tokens
Llama 3.2
Meta
~0
tokens
Llama 3.1 (405B)
Meta
~0
tokens
Llama 3 (70B)
Meta
~0
tokens
Mistral Large
Mistral
~0
tokens
Mistral Small
Mistral
~0
tokens
Grok 2
xAI
~0
tokens
Grok 2 Vision
xAI
~0
tokens
Command R+
Cohere
~0
tokens
Command R
Cohere
~0
tokens
Estimated Input Cost
$0.0000
Estimated Output Cost
$0.0000
Costs are estimates based on approximate token counts. Actual costs may vary depending on the tokenizer used by each provider.
0.0% of context window used
Large language models read and bill text in tokens. The token count decides what a request costs and whether it fits in the model's context window.
Each provider uses its own tokenizer, so the same text gives different counts on different models. This tool estimates counts from a characters-per-token ratio for each model, so you don't need to install any tokenizer libraries. The numbers are approximate.
API cost estimation
Estimate what your prompts and completions will cost with different LLM providers
Prompt engineering
Trim prompts to stay within token limits
Context window planning
Check that your input fits a model's context limit before you call the API
Model selection
Compare token counts and cost across models to find the cheapest one for your use case
What is a token in the context of LLMs?
A token is the unit of text a language model reads. A token can be a word, part of a word or a single character. In English, one token is roughly 4 characters or about 0.75 words. Tokenization varies by model.
How accurate are the token estimates?
They are approximations. The tool divides the character count by a fixed characters-per-token ratio for each model instead of running the real tokenizer. Code and non-English text are the most likely to differ from the actual count. Use the provider's own tokenizer when you need an exact number.
Why do different models have different token counts?
Each provider has its own tokenizer and vocabulary. OpenAI uses tiktoken, and Anthropic, Google and others have their own. Each tokenizer splits text differently, so the same text gives different counts.
How are API costs calculated?
Cost is the token count multiplied by the price per 1,000 tokens. Most providers charge different rates for input tokens (your prompt) and output tokens (the model's response), so the tool shows both. You can edit the prices to match your provider's current rates.
What is a context window and why does it matter?
A context window is the maximum number of tokens a model can handle in one request, counting input and output together. GPT-4 Turbo, for example, has a 128K token context window. If your input is larger than the window, the API returns an error.
Private by default
The tool counts tokens and estimates cost in your browser and sends nothing to a server.
Related tools
Prompt Manager
Save, tag and reuse your ChatGPT, Claude and Gemini prompts. Prompts stay in your browser without an account. Sign in to sync them across devices.
YouTube Transcript
Get the transcript of a YouTube video that has captions, in the language you pick. Read it with timestamps, copy it, or download it as text or SRT. Free, no signup.
Agent Share
Share HTML pages from coding agents and AI tools. Drop a file and get a link. The page renders in a sandboxed iframe with its CSS, fonts and SVG intact.