AI EngineerGuide

Gemini token counter

Estimate Gemini API tokens for your prompt and see the cost and context window use per model.

Runs in your browser. Nothing you paste is uploaded.

Or drop a .txt, .md or .json file here, or . It's read in your browser.

299 characters Β· 53 words

Token counts by tokenizer
TokenizerTokensTypeUsed by
Gemini75estimate characters Γ· 4Gemini API models
OpenAI o200k_base73exact Exact (gpt-tokenizer 4.1.0)GPT-4o, GPT-4.1, GPT-5.x, GPT-6, o-series
OpenAI cl100k_base75exact Exact (gpt-tokenizer 4.1.0)GPT-4, GPT-4 Turbo, GPT-3.5 Turbo, text-embedding-3
Claude 4.7 and later112estimate characters Γ· 3.5 Γ— 1.3Opus 4.7+, Sonnet 5.x, Haiku 5.5, Fable, Mythos
Claude before 4.786estimate characters Γ· 3.5Sonnet 4.5/4.6, Haiku 4.5, Opus 4.6 and earlier

Pick a model to see what these tokens cost as input or output, and how much of its context window they use.

View OpenAI tokens

Each colored block is one token. Only the first 2,000 tokens are shown.

The OpenAI counts for the sample text are already filled in. The two OpenAI tokenizer files (about 1.5 MB compressed) load the first time you edit the text.

How to use it

  1. Paste your prompt or drop a text file.
  2. Read the Gemini row: an estimate based on Google’s guidance of about 4 characters per token.
  3. Pick a Gemini model to see input and output cost and how much of the 1M-token context window you use.

How we estimate Gemini tokens

Gemini doesn’t publish a tokenizer you can run in the browser, so we use Google’s rule of thumb from the Gemini tokens guide: “a token is equivalent to about 4 characters” (checked 2026-11-02). It holds for English prose; code, JSON and other languages usually produce more tokens. For an exact number, use the API’s countTokens method.

FAQ

How many characters is a Gemini token?

Google’s docs say a token is about 4 characters, and 100 tokens are about 60 to 80 English words.

How do I get an exact Gemini token count?

Call the Gemini API’s countTokens method with the model you plan to use. It counts tokens without generating a response.

Do images, audio and video count as tokens on Gemini?

Yes. Gemini converts media to tokens at fixed rates, documented in Google’s tokens guide. This counter only measures text.

Is my text sent to Google?

No. The estimate is computed in your browser and nothing is uploaded.