Prompt & Circumstance

Calculate tokens across the AI landscape.

Your prompts, your rules, your tab. Compare prompt lengths, context usage, and input costs for leading LLMs in real-time — 100% client-side, no servers involved.

FAQs

Feed the tokenizer.

cl100k: 0cl100k_base — OpenAI's tokenizer for GPT-4 Turbo, GPT-3.5 Turbo, and Claude models.·o200k: 0o200k_base — OpenAI's latest tokenizer for GPT-4o, o1, o3, and newer models.·llama3: 0llama3 — Meta's official tokenizer for Llama 3 and Llama 4 models.
tokens (default: 100)

Your Tokens, Uncut.

What is a token? A token is a piece of text processed by an LLM. Roughly 1 token = 4 characters or 0.75 words in English. Each highlighted chunk below represents one token.
Start typing in the input box or upload a file to visualize token chunks...

The Bill Calculator

See how your prompt's/file content cost compares across flagship models
Live · updates as you type
Type a prompt above or upload a file to see cost comparisons across all flagship models.

Tokenomics at a Glance.

Exact Estimate
ModelTokensInput CostOutput CostTotal Cost
Type a prompt above or upload a file to Glance at Tokenomics of flagship models for this provider.
ModelTokensInput CostOutput CostTotal Cost
Type a prompt above or upload a file to Glance at Tokenomics of flagship models for this provider.
ModelTokensInput CostOutput CostTotal Cost
Type a prompt above or upload a file to Glance at Tokenomics of flagship models for this provider.
ModelTokensInput CostOutput CostTotal Cost
Type a prompt above or upload a file to Glance at Tokenomics of flagship models for this provider.
ModelTokensInput CostOutput CostTotal Cost
Type a prompt above or upload a file to Glance at Tokenomics of flagship models for this provider.
ModelTokensInput CostOutput CostTotal Cost
Type a prompt above or upload a file to Glance at Tokenomics of flagship models for this provider.
ModelTokensInput CostOutput CostTotal Cost
Type a prompt above or upload a file to Glance at Tokenomics of flagship models for this provider.
ModelTokensInput CostOutput CostTotal Cost
Type a prompt above or upload a file to Glance at Tokenomics of flagship models for this provider.
ModelTokensInput CostOutput CostTotal Cost
Type a prompt above or upload a file to Glance at Tokenomics of flagship models for this provider.
ModelTokensInput CostOutput CostTotal Cost
Type a prompt above or upload a file to Glance at Tokenomics of flagship models for this provider.

Frequently Asked Questions

Universal LLM Token and Cost Counter is a free, client-side web application that counts tokens and calculates API costs for 60+ LLMs across OpenAI, Anthropic, Google Gemini, Meta Llama, DeepSeek, Mistral, Alibaba, xAI, Nvidia, and Cohere — instantly, in your browser.

Yes. It runs entirely in your browser with no servers, no accounts, no API keys required, and no paywalls. No sign-up is needed — just open the site and start counting tokens immediately.

No. Everything runs locally in your browser. Your text never leaves your device — 0 servers harmed. Once you close the tab, everything is gone.

We support OpenAI, Anthropic, Google Gemini, Meta Llama, DeepSeek, Mistral, Alibaba (Qwen), xAI (Grok), Nvidia, and Cohere — covering 60+ models with real-time token counting and cost comparison.

For OpenAI models, we use the official js-tiktoken library (the same tokenizer used by OpenAI's API). For Meta Llama models, we use llama3-tokenizer-js, Meta's official tokenizer. For other providers without public tokenizers (Anthropic, Gemini, Mistral, Alibaba, xAI), we apply empirically calibrated scale factors based on extensive testing — typically accurate within ~5% for typical inputs. Three encoder counts are displayed — cl100k, o200k, and llama3 — each with an info icon you can hover to learn which models use that encoder. Each model also shows a confidence indicator so you know whether the count is exact or estimated. Note: Claude Sonnet 5 and Opus 4.7+ use a newer tokenizer that produces ~30% more tokens than earlier Claude models, so we apply a higher scale factor (1.35x) for those models.

You can paste plain text, source code, or JSON directly into the input area. You can also upload files in CSV, JSON, TXT, or LOG formats up to 10 MB (10,000 rows) for bulk tokenization. The file is streamed and tokenized entirely in your browser — nothing is uploaded to any server.

We use each provider's published per-token pricing and multiply by the token count for your text. Results show input cost, output cost, and total cost per model, with a "Best Value" badge highlighting the cheapest option for your input. Costs are displayed with adaptive precision — small amounts show more decimal places, larger amounts are rounded — so numbers stay readable without overflowing the layout.

The "Expected response" field lets you set how many tokens you expect the model to generate in its reply. This is used to calculate output costs, which are often significantly higher than input costs. You can set any value from 0 to 99,999 tokens. The default is 100 tokens. Increasing this value gives you a more accurate total cost estimate, especially for models with expensive output pricing.

The Token Visualizer is a color-coded panel that shows exactly how the tokenizer splits your text into individual tokens. Each token is displayed as a distinct colored segment, so you can see precisely where word boundaries, spaces, punctuation, and special characters create separate tokens. This helps you understand what drives your token count and identify opportunities to write more token-efficient prompts.

The Optimize button is a client-side prompt compression tool. It scans your input and removes filler words (like "actually", "basically"), overly polite phrases ("please provide me with…"), wordy constructions ("in order to", "due to the fact that"), and repetitive text — then compresses extra whitespace and blank lines. The result is a leaner prompt with the same meaning, which means fewer tokens and lower API costs. After optimization, a stats bar shows the percentage of tokens saved and the estimated monthly dollar impact based on your usage.

No. The optimizer only removes semantically redundant filler — polite preambles, hedge words, and wordy phrases that add tokens without adding meaning. Core instructions, data, and structure are preserved. You can always undo changes with Ctrl+Z or re-type your original prompt.

We accept .csv, .json, .txt, and .log files up to 10 MB (approximately 10,000 rows). For CSV files, each row is tokenized individually so you can see per-row token counts. The file is streamed and tokenized entirely in your browser — nothing is uploaded to any server.

Providers like Anthropic, Gemini, Mistral, and Alibaba don't publish their tokenizers. We use empirically calibrated scale factors (e.g., 1.07x for older Anthropic models, 1.35x for Claude Sonnet 5 and Opus 4.7+, 1.05x for Gemini) that produce estimates accurate within ~5% for typical inputs.

Yes. After the first load, the app can work offline since all processing is client-side. Your browser caches the necessary resources so you can use the tool without an internet connection.

Comparative Analysis is a visual dashboard that shows five charts: a market share doughnut chart (sourced from real OpenRouter usage data via whatstrending.ai, refreshed twice daily), average input and output cost per provider, your prompt's cost broken down by provider (stacked input + output), and a cost-efficiency ranking showing tokens per dollar. It helps you quickly see which providers dominate the market and which model gives you the best value for your specific prompt.

Market share data is sourced from whatstrending.ai, which aggregates real token throughput from OpenRouter — the largest open LLM API gateway. It reflects actual API usage across the ecosystem, refreshed twice daily. The data is cached in your browser for 12 hours per session to minimize network requests. Your prompt text is never sent to any server; only the market data endpoint is fetched.

Market share reflects OpenRouter API gateway usage and does not include first-party app traffic (e.g., ChatGPT, Gemini app, claude.ai). This means consumer-facing models from OpenAI and Google may appear under-represented compared to developer-facing models. The data is useful for understanding the open API ecosystem but should not be interpreted as overall LLM market share across all usage.

Click the sun/moon icon in the top navigation bar to toggle between light and dark mode. Your preference is saved in your browser's local storage, so it persists across sessions. The app also respects your system's preferred color scheme on first visit.

Yes. After clicking the Optimize button, you can press Ctrl+Z (or Cmd+Z on Mac) to revert the optimization and restore your original prompt. You can also simply re-type or paste your original text at any time.

You can compare all 60+ supported models simultaneously. After entering your prompt, the results table shows token counts and API costs for every model from every supported provider — OpenAI, Anthropic, Google Gemini, Meta Llama, DeepSeek, Mistral, Alibaba, xAI, Nvidia, and Cohere — ranked by cost with a "Best Value" badge highlighting the cheapest option.

The Complexity Score is a client-side prompt quality analysis that produces a single score from 1.0 to 10.0 based on three weighted dimensions: Structural complexity (30%) measures word count, template variable density, and output format constraints like JSON schemas or CSV formatting; Cognitive complexity (40%) detects chain-of-thought reasoning patterns, few-shot examples (Input:/Output: pairs and ### headers), and persona or role framing; Operational complexity (30%) scans for multi-step numbered instructions. The score is classified into three tiers — LOW (1.0–3.9), MEDIUM (4.0–7.4), and HIGH (7.5–10.0) — with a detailed breakdown showing each dimension's contribution and prioritized improvement recommendations to help you write clearer, more efficient prompts. Everything runs locally in your browser.