calc.dev.brAI calculators for developers

Token counter for ChatGPT and Claude

Paste a prompt, a document or some code. You get a token estimate for the GPT-5.6 and Claude tokenizers, plus the cost of sending the text as input on every model.

Prices updated October 2026
count-tokens.tsToken counter

What a token is

Language models don't read letters or words: they read tokens, chunks of text that may be a whole word, part of one or a symbol. In English a token averages about 4 characters; in Spanish and Portuguese tokens are shorter, because tokenizers were trained on more English text.

How we estimate

The counter divides the number of characters by each tokenizer's average characters per token for the language:

TokenizerPortugueseSpanishEnglishCode
GPT-5.63.63.74.23.3
Claude 5.x (Opus, Sonnet, Fable)2.552.62.92.4
Claude Haiku 4.53.33.43.83.1

According to Anthropic, Claude models from 4.7 on use a new tokenizer that produces roughly 30% more tokens for the same text. That's why the same prompt "weighs" more on Opus 5.5 than on Haiku 4.5.

When you need the exact number

The estimate is within about ±15% for ordinary text. Both APIs return the real count with every response (the usage field), and Anthropic offers a free token-counting endpoint you can call before sending.

Text you paste here never leaves your browser.

Frequently asked questions

How many tokens is a word?

In English, about 1.4 tokens per word on GPT-5.6 and about 2 on Claude 5.x models. Other languages use more.

Do spaces and punctuation count?

Yes. Spaces usually attach to the next word, and punctuation marks are tokens of their own.

Is my text sent to a server?

No. Counting happens in JavaScript in your browser.

Estimate based on public prices as of October 2026. Token counts vary with the text and the model; check the official pricing page before you decide.