Token Counter and Cost Calculator

Paste a prompt or code sample and choose a model to estimate the cost of an uncached text request. Your text stays in your browser.

Leave output blank to price a reply of the same token length. Enter 0 to price the prompt alone.

Input tokens
18
Input cost
$0.0000135
Output cost
$0.000081
Cost per request
$0.0000945

Plain-text count using o200k_base, OpenAI tiktoken’s encoding for the GPT-5 family.

Base rate · $0.75 input / $4.50 output per million tokens. Official pricing (2026-11-14)

How much text fits in one million tokens?

These examples use the GPT-5 o200k_base vocabulary. The last column counts how many separate requests fit in one million text tokens when each sends the same sample.

TextCharactersTokensCopies per million tokens
Where is the nearest station?296166,666
最近的车站在哪里?96166,666
const total = input + output;297142,857

Cost per token by model

USD rates below apply to uncached text at the base context tier. DeepSeek uses the recorded peak rate and offers lower off-peak rates. Each pricing guide covers other models, caching and long-context tiers.

ModelPer input tokenPer output tokenPricing guide
Claude Sonnet 4.6 $0.000003 $0.000015 Anthropic API
GPT 5.4 Mini $0.00000075 $0.0000045 OpenAI API
Gemini 2.5 Flash $0.0000003 $0.0000025 Google API
Grok 4.7 $0.000002 $0.000006 xAI API
DeepSeek V4 Pro $0.00000132 $0.00000396 DeepSeek API

Compare API provider prices for the same model

Token counter FAQ

How many characters or words are in a token?

A token can represent a common word, part of a word, punctuation or whitespace. Adding a space or changing a prefix can change how a word is split.

How do Chinese and English token counts compare?

Compare the translations in the table above. A Chinese token can span multiple characters, and a single character can also span tokens. For a bilingual document, paste each version and compare counts with the same model.

Why do token counters disagree?

Vocabularies, normalization and model versions influence token boundaries. Chat APIs also add message roles, history and tool schemas. Use the usage returned by the API to reconcile a bill.

How do I estimate the cost of a conversation?

Paste the system prompt, history and new message sent with the current request. Enter an expected reply length, then add the input and output charges. Count any history sent again on the next turn.

How do I count code, JSON and images?

Paste code or JSON with its original indentation, line breaks and punctuation. Image usage depends on the model, resolution and detail settings. Use the vendor’s multimodal counting API for those requests.

Does my text go to a model provider?

Text is tokenized in a Web Worker in your browser. The tool loads the selected vocabulary locally, keeps your input on the device and needs no API key.

Tokenizer references · OpenAI tiktoken · Anthropic · Google Gen AI SDK · DeepSeek V4

Submit a site