Asistente RD

AI token counter (GPT)

Count the tokens in your text for GPT models (o200k and cl100k), plus characters, words and an editable cost estimate. Everything runs in your browser.

Free · No sign-up · In your browser

Tokens (o200k · GPT-4o / 4.1)

Tokens (cl100k · GPT-4 / 3.5)

Characters

0

Words

0

Loading tokenizer…

Your text is tokenized inside your browser using OpenAI's own tokenizer algorithm. It is never sent to any server.

Cost estimate (input)

Reference prices in USD per million input tokens. Prices change over time: edit them with your provider's current values.

ModelEncodingUSD / 1M tokensTokensEstimated cost
GPT-4oo200k_base$0.00
GPT-4o minio200k_base$0.00
GPT-4.1o200k_base$0.00
GPT-4 Turbocl100k_base$0.00
GPT-3.5 Turbocl100k_base$0.00

o200k_base is the encoding used by GPT-4o, GPT-4o mini and GPT-4.1. cl100k_base is used by GPT-4, GPT-4 Turbo and GPT-3.5 Turbo. The same text can produce a different token count depending on the encoding.

Share on WhatsApp Last reviewed: July 9, 2026

What a token is, and why we count them

Large language models like GPT don’t read characters or words — they read tokens. A token is a chunk of text (sometimes a whole word, sometimes a sub-word or a single character) that the model treats as one unit. Before GPT processes anything you type, it splits your text into this sequence of tokens using a method called BPE (Byte Pair Encoding).

As a rough rule of thumb, in English one token is about 4 characters, or roughly 0.75 words. Other languages run higher: Spanish, French or German words tend to be longer and get split into more pieces. This tool counts the exact tokens in your text using the same tables OpenAI ships, so there’s no guesswork.

Why counting tokens matters

Token counting isn’t a purely academic exercise. It answers two very practical questions:

  • Context limits. Every model has a maximum number of tokens it can read and generate in a single conversation — its “context window.” If your prompt plus the conversation history exceeds that limit, the request fails or gets truncated.
  • API cost. Providers bill per token, not per word. Knowing how many tokens a prompt uses lets you estimate the price before you send it — critical when the same call runs thousands of times in production.

How to use the counter

  1. Paste or type your text into the box. The count updates live.
  2. Read the token totals for the two main encodings: o200k (GPT-4o, GPT-4.1) and cl100k (GPT-4, GPT-3.5).
  3. Edit the price table with your provider’s current rates to see the estimated input cost.

Everything happens in your browser: your text is never sent to a server.

The difference between encodings

Each model generation uses a different “encoding” — a different vocabulary of tokens. cl100k_base powers GPT-4 and GPT-3.5; o200k_base is newer and more efficient, especially for languages other than English. That’s why the same non-English text often produces fewer tokens under o200k than under cl100k.

Worked example

Take the sentence Hola, ¿cómo estás? Espero que muy bien. — it’s 39 characters. Tokenized:

TextCharacterso200kcl100k
Hello, world!1344
Hola, ¿cómo estás? Espero que muy bien.391114
El murciélago comía ñoquis en el jardín soleado.481619

The Spanish sentence is 11 tokens in o200k but 14 in cl100k — the newer encoding is about 21% cheaper for the same text. Notice that Hello, world! costs the same (4 tokens) in both, while the non-English lines always cost more. Sent to GPT-4o at a reference price of 2.50 USD per million tokens, that 11-token input would cost 11 ÷ 1,000,000 × 2.50 ≈ 0.0000275 USD. Trivial once — until you multiply it by 100,000 calls a month.

Frequently asked questions

How many characters is one token?

In English, roughly 4 characters per token on average. In languages like Spanish the average drops to around 3–3.5 characters, because accents and longer endings get split more often. It’s not a fixed number: it depends on the text and the encoding.

Why do some languages use more tokens than English?

Because the token vocabulary was trained on far more English text than anything else. Common English words fit in a single token; their equivalents in other languages are often split into two or three. For instance, internationalization is 2 tokens, while the Spanish internacionalización is 3 in o200k — same letter count, more tokens.

Does this work for GPT-4o and GPT-4?

Yes, but they use different encodings: GPT-4o and GPT-4.1 use o200k_base, while GPT-4 and GPT-3.5 use cl100k_base. That’s why the tool shows both counts side by side — read the one that matches your model.

Are the prices in the table official?

No. They’re reference values for a quick estimate. API prices change often and vary by provider, which is why the table is editable. Before making budget decisions, confirm the current rate on your provider’s official pricing page.

Does this counter include the cost of the response?

No. It counts input tokens only (your prompt). Models also charge for the output tokens they generate, usually at a higher rate. For a full cost you’d need to add the response tokens on top.

Related tools