Free AI Utility

AI Token Counter

Paste any prompt or document to estimate its token count, preview per-model API costs, and see how much of a 128K or 200K context window it would consume.

No text? Load a sample:

Your input is processed in your browser and is not stored by us.

Trim before you send

Remove greetings, repeated instructions and filler phrases from prompts. Moving shared instructions into the system prompt (sent once) instead of every user message can cut token spend by 30–50% on multi-turn workflows.

Structure beats narrative

Markdown tables, bullet lists and JSON compress the same information into far fewer tokens than prose. Ask models to "respond as a table" when you only need the data.

Right-size the model

Cheap, fast models (Flash-class) handle classification, extraction and formatting at a fraction of flagship cost. Reserve frontier models for reasoning-heavy work — the cost table above shows why this matters at scale.

How to use the token counter

  1. Paste your text

    Drop in a prompt, system message, article, or document — or load the sample. Everything is analyzed locally in your browser; nothing is uploaded.

  2. Read the token estimate

    The estimate blends ~4 chars/token and ~0.75 words/token heuristics. Code, JSON and non-Latin scripts tokenize less efficiently, so treat those estimates as lower bounds.

  3. Check context-window usage

    The bars show what fraction of a 128K or 200K context window your text would occupy — essential before stuffing long documents into a prompt.

  4. Preview API costs

    See what this text would cost as input vs. output tokens on GPT-4o, Claude Sonnet and Gemini 2.0 Flash at approximate 2026 prices.

This is a heuristic estimate, not a vendor tokenizer. For billing-grade precision, validate with the provider's own tokenizer before committing to large workloads.

Frequently Asked Questions

Now Make That Prompt Better.

Fewer, better-chosen tokens beat more tokens. Structure your prompt properly before you send it.

Estimates only: token counts are heuristic approximations, not vendor tokenizer output. Prices are approximate 2026 public list rates — always verify current pricing on the vendor's own page before budgeting. Your text is processed entirely in this browser.

Related tools

Need a custom tool?

We build calculators and internal tools for businesses — get in touch.

Directory last updated 2 December 2026.