Tokens Calculator

Token Calculator

Count tokens and estimate API cost for GPT, Claude, and Gemini — locally in your browser.

o200k_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.

One text, clearer model decisions

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.

Built for fast, private token checks

Runs locally

Your text is processed on your device. Nothing is uploaded to Tokens Calculator.

Compare models

See the same text through GPT-4o, GPT-4, Claude, and Gemini-compatible encodings.

Estimate cost

Apply published per-million-token list prices to either input or output token usage.

How it works

  1. 01

    Paste text

    Paste or type the text you want to measure into the calculator.

  2. 02

    Select a model

    Choose a GPT, Claude, or Gemini model to apply its compatible local encoding and published price.

  3. 03

    Review tokens and cost

    Read the token, character, word, and estimated API cost values. Switch between input and output pricing when needed.

Token Calculator FAQ

Is my text sent to your servers?

No. Token counting and price estimation run in your browser. Tokens Calculator does not upload, store, or inspect the text you paste.

Why can token counts differ between models?

Models use different tokenizers. This tool uses o200k_base for GPT-4o and cl100k_base for GPT-4 plus useful Claude and Gemini approximations, so results can vary by model family.

Do the API cost estimates include output tokens?

Choose Input or Output in the calculator. The estimate applies the selected model's published list rate to the token count in your text; it does not combine both directions into one invented request total.

Are the prices always current?

Prices are stored in a small configuration file and checked against provider documentation. Providers can change pricing, so follow the provider-pricing link before making a production budget decision.

Not affiliated with Anthropic, OpenAI or Google.