↑↓ to move ↵ to open Esc to close Browse all tools

Token Counter

Paste a prompt, a document or code and see how many tokens it uses, how they are split and how much of a context window it fills.

Your text

Tokens
0

Paste some text to count its tokens.

Words
0
Characters
0
Tokens per word
-
Characters per token
-

Context window

How the text is split

The tokens appear here, each in its own color.
What does it cost?

Your text is counted by your own browser. Nothing is uploaded.

Free printableFree Resume TemplateThree clean one-page designs as an editable Word file, with a PDF example. Hand-checked listFree AI Chatbots ComparedWhat the free plans of 9 AI chat assistants include, checked on each vendor’s own pricing or help page.

Token Counter by Freebiefy, free online tools · Privacy · Legal notice

Embed this tool on your site

Paste this code into your page. The tool runs in the visitor's browser, free and without signup. The height adjusts to the content. All tools you can embed

Count tokens before you send a prompt

Large language models (LLMs) do not read letters or words, they read tokens. Every API call is billed per token, every model has a context window measured in tokens, and long prompts that exceed it are cut off or rejected. Counting tokens first tells you whether a document fits, how much a request will cost and whether it is worth shortening your prompt.

This counter uses the real OpenAI tokenizers, so counts for GPT models match OpenAI's own count for the same text; the API adds a few tokens per chat message for formatting. It also shows how your text is split. That makes it easy to spot what is expensive: long URLs, repeated boilerplate, tables with lots of symbols or text in languages other than English.

Rules of thumb for English text

TextAbout
1 token4 characters or ¾ of a word
100 tokens75 words
1 page of text (500 words)670 tokens
A 90,000-word novel120,000 tokens

Code, data, other languages and emoji need more tokens than this. Count them to be sure.

Claude, Gemini and other models

Each AI provider trains its own tokenizer. Anthropic Claude, Google Gemini, Meta Llama and others split text differently from OpenAI, so the same prompt has a different token count with each of them. Treat the count here as an estimate for those models. For exact numbers, use the token counting option in the provider's own API or console. With a token count in hand, the AI cost comparison shows what the same job costs on different AI models.

How to use the token counter

  1. 1Paste your prompt, document or code, or open a text file from your device.
  2. 2Pick the tokenizer for your model. GPT-4o and newer is right for current OpenAI models.
  3. 3Read the token count and context window use, and see the split below. Press "What does it cost?" to compare model prices for this prompt.

Frequently asked questions

What is a token?

A token is the unit AI models read and write. Common English words are often one token, longer or rare words are split into pieces, and spaces and punctuation are usually part of a token. As a rule of thumb, 1,000 tokens are about 750 English words.

How exact is the count?

For the text itself it matches OpenAI exactly: the counter uses the same tokenizers, o200k_base for GPT-4o, GPT-4.1, GPT-5 and the o-series, and cl100k_base for GPT-4 and GPT-3.5. A chat request through the API adds a few tokens per message for formatting. Claude, Gemini, Llama and other models use their own tokenizers, so their counts differ. Use the result as an estimate for them.

Why do other languages and code use more tokens?

OpenAI notes that the ratio of tokens to characters differs between languages, and text that is not English often needs more tokens. Long compound words, accented letters, many Asian scripts, emoji and code full of symbols tend to be split into more pieces, as the split view shows, so the same meaning costs more tokens.

Is my text sent anywhere?

No. The tokenizer runs in your browser. Your prompt, document or code is counted on your own device and never sent to a server or to an AI provider.

What does the context window mean?

The context window is the most tokens a model can handle in one request, counting your input and its answer together. If your prompt fills most of the window, leave room for the reply, or split the document into parts.