Tokens Calculator

Gemini Token Calculator

Estimate Gemini-compatible text tokens and API cost locally, with a clear note about what a browser-side approximation can and cannot do.

cl100k_base
0 / 1,000,000 characters

Token visualization

Local token pieces update 0.5 seconds after you stop typing.

0 tokens

Paste text above to see how the selected local encoder splits it into tokens.

Local calculation. Your text stays in this browser. Nothing is uploaded or stored by Tokens Calculator.

Compare local estimates across models

Compare the same text using the available local encodings and current list-price estimates.

Edit text
ModelTokensInput / 1MInput cost
GPT-4oOpenAI0$2.50$0.000000
GPT-4OpenAI0$30.00$0.000000
Claude 3.5 SonnetAnthropic0$3.00$0.000000
Claude Sonnet 4.6Anthropic0$3.00$0.000000
Gemini 2.5 FlashGoogle0$0.30$0.000000
Gemini 2.5 ProGoogle0$1.25$0.000000

Claude and Gemini counts are useful approximations using cl100k_base; provider tokenizers can differ by model version and text.

Transparent approximation

The page labels cl100k_base as an estimate so you can distinguish useful planning data from provider-side billing totals.

Context-aware Pro pricing

The Gemini 2.5 Pro reference changes at 200K input tokens, matching the standard published rate tiers in pricing.ts.

Local by design

No API key, network request, or provider call is required to count the text you paste here.

How it works

  1. 01

    Add the text to measure

    Paste the text portion of a prompt or response into the calculator.

  2. 02

    Select a Gemini reference

    Choose Gemini 2.5 Flash or Gemini 2.5 Pro to apply its configured list-price rate.

  3. 03

    Use the result as a plan

    Review the local cl100k_base approximation and input or output estimate before confirming a provider-specific count.

Gemini Token Calculator FAQ

Is this an official Gemini tokenizer?

No. This static tool uses cl100k_base as a useful browser-side text approximation because it intentionally ships only local open BPE encodings. Google’s exact Gemini count can differ.

Which Gemini prices are included?

The selector includes Gemini 2.5 Flash and Gemini 2.5 Pro standard text rates. Gemini 2.5 Pro switches to a higher standard rate above 200K input tokens, which the local estimate accounts for.

Does this calculator make a Gemini API request?

No. It is a fully local browser calculator. It does not call Google, submit your content, or require an API key.

Why should I still check the provider price page?

Model pricing, context tiers, tools, audio or media inputs, caching, taxes, and regional terms can affect a real invoice. Follow the provider link before making a production budget decision.

Not affiliated with Anthropic, OpenAI or Google.