Quecko Logo

Free tool • Runs in your browser

LLM token counter

Count tokens with the o200k_base tokenizer, estimate other models, and see how much of a context window your text fills.

Loading tool...

Quick answer

Models read text as tokens, which are pieces of words. In English, one token is about four characters. Each model family has its own tokenizer, so counts for other providers are estimates. Use the provider's token counting API when you need an exact number.

How to use it

  1. Paste a prompt, document or conversation.
  2. Read the token count alongside words, characters and lines.
  3. Check what share of a 200K or 1M context window the text would use.

Example

Input
The quick brown fox jumps over the lazy dog.
Output
Words: 9
Characters: 44
Lines: 1
Rough estimate at 4 characters per token: 11

Common errors and how to fix them

The count differs from my API bill
A request also includes the system prompt, full conversation and tool definitions, and the model's output is billed too.
The prompt is too long for the model
Trim old messages, summarise them, or send only the relevant parts of your documents.

Frequently asked questions

How do LLM tokens work?

A model splits text into tokens, which are often whole words or pieces of words. It reads and writes tokens, and API usage is commonly billed by them.

How do you count LLM tokens?

Paste your text here for an o200k_base count and a rough estimate. For an exact count on a specific model, use that provider's tokenizer or token counting API.

How are LLM tokens calculated?

A tokenizer maps text to tokens using rules learned for that model. In English, one token is about four characters, or three quarters of a word.

How many tokens is a word?

About 1.3 tokens per English word on average. Code, unusual words and other languages often use more.

How can I reduce LLM token usage?

Remove repeated instructions, send only the relevant parts of documents, summarise old messages, and cap the output length.

How do I estimate LLM token usage for a request?

Add up the system prompt, conversation history, tool definitions and new message, then add the expected output. Each request can include all of them.

Is this token count exact for Claude or Gemini?

No. o200k_base is an OpenAI tokenizer, so other models will differ. Use the provider's own counting tool for an exact figure.

What is a context window?

It is the maximum number of tokens a model can work with in one request, including your input and its answer.

Do spaces and punctuation count as tokens?

They are part of the text being split, so they affect the count. A space is often attached to the word after it.

Is my text uploaded?

No. Counting happens in your browser and your text is not sent to Quecko.

More AI tools

Need something built for your business?

Quecko designs and builds AI, Web3 and custom software products.

Start a Project