---
title: "Token Counter: Exact GPT-4o & GPT-4 Tokens | Prompt Pebble"
description: "Exact token counts for OpenAI's o200k_base (GPT-4o and later) and cl100k_base (GPT-4) encodings, a token-by-token view, and rough figures for other models."
url: https://promptpebble.click/token-counter/
---

Exact for OpenAI encodings · estimate for others

# Token counter

Paste text to count its tokens exactly with OpenAI's o200k_base and cl100k_base encodings, see where each token starts and ends, and check how much of a context window it fills. Other models get a clearly labelled rough estimate.

## How the counting works

Language models read text as tokens: common words are often one token, rarer words are split into pieces, and spaces and punctuation count too. This page runs the open-source gpt-tokenizer library in your browser, which implements the same encodings as OpenAI's tiktoken, so the o200k_base and cl100k_base figures are exact for the text itself.

Use o200k_base for GPT-4o and later OpenAI models, and cl100k_base for GPT-4, GPT-4 Turbo, GPT-3.5 Turbo and the text-embedding-3 models. In a chat request each message also carries a few tokens of formatting, so the usage an API reports will be slightly higher than the count of your text.

### Other models

Anthropic, Google, Meta, Mistral and others use their own tokenizers, which this page doesn't include. Some providers, Anthropic among them, don't publish the tokenizer their current models use and offer a token-counting API instead. For these models you get a rough estimate: about four characters per token for English (OpenAI's rule of thumb) and one per character for Chinese, Japanese and Korean. Use the provider's own counter when you need an exact number.

Sources: *What are tokens and how to count them?*, OpenAI Help Center; tiktoken and gpt-tokenizer (MIT licence).

## Tips

- Drop a .txt or .md file onto the box, or use Open file.
- Set your model's context window and how much room to keep for the reply to see what is left.
- Turn on token IDs to see the numbers the model actually receives.

## Questions

**How many words is 1,000 tokens?**

For ordinary English prose, roughly 750 words, from OpenAI's rule of thumb that 100 tokens are about 75 words. Code, numbers, names and other languages usually need more tokens per word.

**Why do o200k_base and cl100k_base give different counts?**

They are different vocabularies. o200k_base has about 200,000 tokens and cl100k_base about 100,000, so o200k_base can often cover a word or phrase in fewer tokens, especially outside English.

**Is the figure for Claude or Gemini exact?**

No. It is a rough estimate from the length of the text, labelled as such, because this page doesn't include those tokenizers. Use the token-counting tools from Anthropic or Google when you need an exact count.

**Is my text sent anywhere?**

No. The tokenizer files are downloaded from this site once, then all the counting happens on your device. Nothing you paste leaves your browser.
