AI Token Counter & LLM Cost Calculator
AI Token Counter tokenizes your text in the browser and shows what it costs to send to the popular LLM APIs. Counts are exact for OpenAI models (o200k_base encoding) and clearly-labelled estimates for Claude and Gemini, whose tokenizers aren't public — Claude typically tokenizes 10–20% higher than the GPT count. The built-in price table covers current GPT, Claude and Gemini models per million input/output tokens and is fully editable, so it never goes stale. Nothing you paste leaves your device — useful when the prompt you're costing is confidential.
Last updated: July 2026
To count tokens, paste your prompt — it's tokenized locally with the same o200k encoding OpenAI's models use, giving exact counts for GPT models and close estimates for Claude and Gemini (which use their own tokenizers). The cost table then multiplies your input and expected output tokens by each model's per-million-token price, and every price is editable so you can keep it current or add your own models.
How to use AI Token Counter & LLM Cost Calculator
- Paste your prompt or document.
- Read the token count, character and word stats.
- Set your expected output length and compare cost per model — edit any price to match current rates.
Frequently asked questions
How many tokens is my text?
Paste it here — as a rule of thumb English text runs ~4 characters or ~0.75 words per token, but the exact count depends on the tokenizer; this tool computes it precisely with the o200k encoding used by current GPT models.
Are the counts exact for Claude and Gemini?
No — Anthropic and Google don't publish their tokenizers. The tool shows the GPT-tokenizer count plus an adjusted estimate for Claude (typically 10–20% more tokens for the same text). For billing-accurate Claude counts, use Anthropic's count-tokens API endpoint.
How is cost calculated?
Input tokens × the model's input price per million, plus your expected output tokens × the output price per million. Prices ship with current published rates and every cell is editable.
Is my prompt uploaded?
No — tokenization happens entirely in your browser, so it's safe to paste confidential prompts and documents.
Related developer tools
Word Counter
Free word counter and character counter. Count words, characters, sentences, paragraphs and reading time as you type. Private and instant.
Character Counter
Count characters, words, sentences and paragraphs with and without spaces. Real-time character counter for Twitter, SEO meta descriptions, titles and essays — runs in your browser, private and free.
JSON Formatter & Validator
Format, beautify, minify and validate JSON instantly. Free, private, in-browser JSON formatter with clear error messages.
AI Prompt Generator
Generate structured, effective prompts for ChatGPT, Claude, Gemini and other AI tools. Fill in the blanks — free, in-browser, no upload.