AppCrib
Developer Tools

A Token Counter for GPT, Claude, and Gemini in One Clean Tool

How do I count tokens for GPT, Claude, and Gemini in one tool?

Open Toklen, paste your prompt, pick a model. The count appears. That's the tool. It runs entirely in your browser using js-tiktoken, shows your context window usage as a colored bar, and gives a six-decimal cost estimate against pricing we update each quarter. No sign-up. No popup asking for your email. No spreadsheet upsell. The text never leaves your machine.

If you work across providers, you've probably been bouncing between three or four sites to get a number you trust. Toklen exists because that workflow is broken, and the existing tools each fail in a specific way.

What's wrong with the token counters that already exist?

The token counter market is busy and mostly free, but most options have a hole somewhere.

OpenAI's official tokenizer is authoritative for GPT and renders the token boundaries beautifully. Then you try to count a Claude prompt and realize it doesn't support Claude at all. You leave.

GPT for Work covers GPT, Claude, and Gemini, but the page exists to funnel you toward a paid Google Sheets add-on. The header, the footer, and the sidebar all want a click that isn't the tokenizer. For a tool that should take three seconds, the friction is loud.

Tokencounter.org still shows pricing from the GPT-3 and GPT-4 era. If you're estimating a 50,000-token prompt against numbers from two years ago, the cost you compute is fiction.

Tokencalculator.com supports more than fifty models, which is impressive, until you notice some of those models show pricing as $0.00. The breadth is real. The trust isn't.

And nearly every web tool that claims Claude support is silently using tiktoken, the OpenAI tokenizer, as an approximation. The number shows up as if it were exact. It isn't, and most users have no way to know.

Toklen's whole bet is that fast and honest can coexist.

How does the context window usage bar work?

Pick a model, type or paste your text, and a horizontal bar fills as your token count grows. It shows X / Y tokens with a percentage, where Y is the context window of the model you've selected. Claude 3.5 Sonnet's bar maxes at 200,000. GPT-4o's at 128,000. Gemini 1.5 Pro's at 2,000,000.

The bar changes color at thresholds you actually care about. Green up to 75%. Amber from 75% to 90%. Red above 90%.

If you blow past 100%, the bar caps visually but the percentage keeps climbing, so a 230,000-token prompt against Claude reads as 115%. You see exactly how far over you are, not just "too long."

This is the feature you didn't know was missing until you used it. None of the competitors visualize headroom. They give you a number, and you do mental math against a context window size you have to remember. Toklen draws the bar so you don't have to.

How accurate is the Claude and Gemini token count?

It's an approximation, and Toklen labels it that way directly under the count. The label reads "Approximation via tiktoken." That sentence does a lot of work.

For GPT models, the count is exact. js-tiktoken loads the same BPE vocabularies (cl100k_base for GPT-4 family, o200k_base for GPT-4o and successors) that OpenAI's API uses. The number you see is the number you'll pay for.

For Claude and Gemini, no client-side tokenizer is published by the provider. Anthropic exposes a messages.countTokens endpoint, but calling it requires a server and an API key, which would break the no-backend, browser-private design. So Toklen uses tiktoken's cl100k_base as a proxy. In practice it's within a few percent for English prose. The label tells you the math is close, not authoritative, so you can decide whether close is good enough for what you're doing.

The honest version of this question is: do you want a number fast and labeled, or a number slow and exact? Toklen picks fast and labeled. If you need the exact Claude count for a billing-sensitive workload, hit Anthropic's API. For everything else (sizing a system prompt, checking RAG context budget, comparing prompt drafts) the approximation is the right tool.

How do I calculate the cost of a prompt before sending it?

Paste your text, pick a model, and the cost appears under the token count, calculated to six decimal places using (token_count / 1,000,000) * price_per_1M_input_tokens. Empty input shows $0.000000. The math is the simplest part.

The harder part is keeping pricing current, and that's where most tools fail quietly. Toklen carries a "Prices as of [Month Year]" label next to the cost. When the label says May 2026, the prices were verified against provider pricing pages in May 2026. We update quarterly. The label tells you exactly how stale the number is, so you can re-check at the source if your decision is sensitive.

Three numbers across three providers, recently verified. That's the goal. If a price drops between updates and we haven't caught it yet, the label shows you when to check the canonical page. No spinner, no "we're working on it." Just a date you can read.

Is my prompt text sent to a server when I count tokens?

No. Everything runs in your browser. Toklen is a static export: HTML, JavaScript, and a WASM bundle. The js-tiktoken library does the counting locally. The only network calls the page makes are loading the page itself and a privacy-respecting analytics ping that doesn't include your text.

That matters when you're pasting a draft prompt that contains an API key, a customer record, or anything else under an NDA. The text goes from your clipboard into a textarea and stays there. Close the tab and it's gone.

This is also why Toklen works offline after the first load. You can use it on a plane.

What models does Toklen support?

The launch set covers eleven models grouped by provider:

  • OpenAI: GPT-4o, GPT-4 Turbo, GPT-3.5
  • Anthropic: Claude 3.5 Sonnet, Claude 3 Opus, Claude 3 Haiku
  • Google: Gemini 1.5 Pro, Gemini 1.5 Flash, Gemini 2.0 Flash

Default is GPT-4o because it's the most common production default. Switch models from the dropdown and the count, cost, and context window bar all update at once. The model info panel below shows the context window size, input price, output price, and tokenizer family for whichever model you've picked, so you don't need to keep a second tab open.

When new models ship and we verify their pricing, they get added in the next quarterly update.

Try Toklen

Toklen lives at appcrib.com/toklen. Free, browser-private, and the tool is the landing page. No scroll, no signup, no upsell. Paste a prompt, see what it costs, ship the better version.

Toklen
Token count, cost, and context window for GPT, Claude, and Gemini.
Try Toklen