Skip to content
Work data is processed in your browser, not stored on our servers.
tools
GPT Token Count and Cost Calculator

GPT Token Count and Cost Calculator

Use an o200k_base or cl100k_base encoder to count tokens, characters, words, and bytes and estimate cost from an input-token price.

Text
Token counts update as you type. Your text never leaves this browser.
Tokens
Select a model encoding.

Encoding: o200k_base

…
Tokens
Characters
100
Words
20
Bytes
183

Estimated cost: …(input only)

Counts follow OpenAI's tiktoken encodings. Other models such as Claude and Gemini tokenize text differently, so their counts may vary.

Key features

  • Switches between o200k_base for GPT-4o-family models and cl100k_base for GPT-4-family models
  • Counts tokens, characters, whitespace-delimited words, and UTF-8 bytes as you type
  • Estimates cost from a user-supplied USD price per one million input tokens
  • Loads only the selected GPT encoder module when needed

How to use

  1. Choose the relevant GPT encoding family and enter your text.
  2. Review token and supporting counts, then adjust the input price if needed.

Examples

  • Check GPT input length

    Measure text under the selected GPT encoding alongside character and UTF-8 byte counts.

  • Estimate input cost from your own rate

    Enter an input-token rate from your plan or documentation for a simple estimate.

Privacy

Text and token calculations stay in your browser and are not sent to the OpenAI API for counting. The selected encoder code is loaded on demand as a QuickKit site asset.

Requirements

The estimate applies only the input-token price you provide. It does not include chat-format overhead or tokenization used by other model families such as Claude or Gemini.

Common questions

Is the displayed cost an actual API charge?
No. It only multiplies the text's token count by the USD input price per million tokens that you enter. Output tokens, request-format overhead, and actual billing rules are excluded.
Does this count Claude or Gemini tokens too?
No. It uses only the selected GPT-family o200k_base or cl100k_base encoding. Other model families can produce different counts.