Free & Open Source

Count Tokens.
Estimate Cost.

Instant token counting for GPT, Claude, and more.
Know exactly what your prompts will cost before you send them.

Loading tokenizer...
Try:

Runs entirely in your browser — your text never leaves your device.

Built for developers who care about precision

No guesswork. No surprises. Every token counted with accuracy you can trust.

Multi-Model Support

Count tokens for GPT-4o using Tiktoken (the same tokenizer OpenAI uses), and estimate for Claude, Gemini, and Llama.

Accurate Cost Estimation

See exactly how much each prompt will cost at current API pricing. Know before you spend.

Shareable Links

Generate a URL with your text pre-filled. Share prompts with your team, or save your work for later.

Client-Side Only

Everything runs in your browser. Your text never leaves your device. No server, no logs, no tracking.

No Signup Required

Open the page and start counting. Zero friction, zero commitment.

Open Source

Built with open-source tooling. Audit the code, fork it, deploy your own instance.

Three steps to know your token count

01

Paste Your Text

Enter any text, prompt, or document into the input field. Works with any language.

02

Select a Model

Choose GPT-4o for exact token counts, or Claude for a statistical estimate.

03

Get Your Count

See the token count and estimated API cost instantly. Copy the result with one click.

Current API pricing

Token counts are calculated against these official API rates. Prices are in USD per million tokens.

Model Input Output Tokenizer
GPT-4o $2.50 / MTok $10.00 / MTok Exact (Tiktoken)
Claude 3.5 Sonnet $3.00 / MTok $15.00 / MTok ≈ Estimated

Pricing sourced from OpenAI and Anthropic official pricing pages. Subject to change. Output costs are shown for reference — input tokens are what you count with this tool.

Frequently asked questions

What is a token?

A token is the basic unit of text that AI models process. For English text, one token is roughly 4 characters or 3/4 of a word. "hello world" is about 2 tokens. AI pricing is typically quoted per million tokens (Mtok).

How accurate is the token count?

For GPT models, we use Tiktoken — the same tokenizer library OpenAI uses in production. The count is exact. For Claude and other models, we use statistical estimation based on character-to-token ratios, so those counts are approximate (marked with "≈").

Why does Claude show an estimated count?

Anthropic has not released their tokenizer publicly. We estimate Claude tokens using ~3.75 characters per token, which is a reasonable approximation. For production use cases, we recommend testing with the official Anthropic API.

Is my text sent to any server?

No. All tokenization happens in your browser using the Tiktoken WebAssembly module. Your text never leaves your device. There are no analytics, no logs, and no server-side processing.

What models are supported?

Currently GPT-4o (exact count via Tiktoken) and Claude 3.5 Sonnet (estimated). We plan to add Gemini, Llama, and Mistral tokenizers in future updates.

How do I use the shareable link feature?

Simply type or paste your text, and the URL updates automatically with your content. Copy the URL from your browser address bar and share it. Anyone who opens that link will see your text pre-loaded.

What is the maximum text length?

The current limit is 100,000 characters. For longer documents, consider splitting them into sections.

Can I use this commercially?

Yes. Token Counter is free to use for any purpose, commercial or personal. The code is open source under the MIT license.

Start counting tokens now

No signup. No tracking. Just accurate token counting in your browser.

Try Token Counter