AI & Productivity Tools

AI Token Counter

Estimate tokens, words, characters, sentences, and context-window usage for pasted text with a selectable model profile.

AI Token Counter — Online Calculator

🔢

AI Token Counter

Count tokens for your text across different AI models. Helps estimate API costs and context window usage.

0 characters
Estimated Tokens — GPT-4o
0
≈ Estimate
Exact tokenizers require browser WASM — estimate is typically ±5%
Characters
0
Words
0
Sentences
0
Chars / Token
—
Context Window Usage0.0%
0 of 128,000 tokens used

Context Usage by Model

GPT-4o
0.0%
128K ctx
GPT-4 Turbo
0.0%
128K ctx
GPT-3.5 Turbo
0.0%
16K ctx
Claude 3.5 Sonnet
0.0%
200K ctx
Gemini 1.5 Pro
0.0%
1000K ctx
DeepSeek V3
0.0%
128K ctx

The AI Token Counter estimates how many tokens a piece of text will consume in a large language model, and benchmarks that estimate against the context window of the model you select: paste your text, choose a profile (GPT-4o, GPT-4 Turbo, GPT-3.5 Turbo, Claude 3.5 Sonnet, Gemini 1.5 Pro, or DeepSeek V3), and it reports estimated tokens, characters, words, sentences, lines, paragraphs, the characters-per-token ratio of your text, and what percentage of the model's window the text would occupy.

How It Works

The counter is deliberately transparent about being an estimator. It blends the two classic rules of thumb, characters divided by 4, and words divided by 0.75, averages them, and never reports fewer tokens than words:

Estimated tokens=max⁡(Words, round(12(Characters4+Words0.75)))\text{Estimated tokens}=\max\Big(\text{Words},\ \text{round}\Big(\tfrac{1}{2}\big(\tfrac{\text{Characters}}{4}+\tfrac{\text{Words}}{0.75}\big)\Big)\Big)

Context usage is the estimate divided by the selected model's stored window (128,000 for GPT-4o, 16,385 for GPT-3.5 Turbo, 200,000 for Claude 3.5 Sonnet, 1,000,000 for Gemini 1.5 Pro in this tool's profiles), and the result is flagged when it exceeds the window.

Parameters

| Input | Required | Meaning | |---|---|---| | Text | Yes | The text to measure (processed locally, never sent anywhere) | | Model profile | Yes | Sets the context window for the usage percentage |

Worked examples

A 40-word paragraph of 160 characters estimates 47 tokens (character estimate 40, word estimate 53.3, blended to 46.7 and rounded). Scale up: a 3,000-word article of about 18,000 characters estimates 4,250 tokens, which is 3.3% of GPT-4o's 128k window but about 26% of GPT-3.5 Turbo's 16,385-token window, leaving that smaller model far less room for a system prompt, conversation history, and its own reply, which is exactly the planning judgement the percentage exists to support. The characters-per-token readout (4.2 in the article example) is the diagnostic to watch: ordinary English prose sits near 4, and a text reporting 3 or below is telling you it tokenizes expensively before you learn it from an API bill.

Why an estimate, and how far to trust it

Exact token counts require the model's own tokenizer, a byte-pair encoding vocabulary trained on enormous corpora, which splits text into chunks that are sometimes whole words, sometimes syllables, sometimes single characters. No character formula reproduces it exactly, and this counter says so rather than dressing a heuristic as a measurement. In practice the blend tracks published tokenizer counts for English prose within roughly 10%, which is ample for the decisions the tool serves: will this document fit, how much of the window remains for the reply, what will this prompt cost at scale (the LLM API Cost Calculator takes the next step), and is this RAG chunking strategy sane. It degrades predictably where tokenizers themselves get expensive: code (dense punctuation and indentation tokenize poorly, often nearer 3 characters per token), JSON and markup, non-English languages (many scripts encode far less efficiently in vocabularies trained predominantly on English), and text heavy in rare words, numbers, or emoji. For those, treat the estimate as a floor and verify against the provider's tokenizer before a hard limit matters.

Context windows, honestly framed

The window is the model's total working memory for one request: your text, the system prompt, any tool definitions, the conversation so far, and the model's reply all draw from the same budget, so a paste that fills 90% of the window leaves a reply no room to exist. Windows in the profiles are the headline figures providers publish; effective usable context can be lower in hosted products with their own wrappers, and model quality over very long contexts is its own research topic (recall degrades in the middle of enormous contexts even within nominal limits). The counter's over-limit flag is therefore a floor of caution, not a ceiling of safety: plan headroom deliberately, especially for chat applications where history compounds silently with every turn.

Frequently Asked Questions

How many tokens is a word, roughly?

About 1.33 tokens per word in typical English (the 0.75 words-per-token rule), or about 750 words per 1,000 tokens. The Tokens to Words Converter on this site runs the conversion in every direction with adjustable ratios when you need the number without a text to paste.

Does the counter send my text to an API?

No. The estimate is computed in your browser from the pasted text alone. That privacy property is worth having for drafts, contracts, and code you would not paste into a third-party tokenizer service.

Why does the same text show different percentages for different models?

Because the estimate of the text is constant while the windows differ: the percentage is tokens relative to the selected model's capacity. The tokens figure is the portable one; the percentage is the model-specific planning signal.

Related Tools