Token & Cost Counter
Paste any text — a prompt, a system message, a whole codebase — and see how many tokens it costs across 13 models from four providers. Everything runs in your browser.
Heads up — these are estimates. I'm using OpenAI's tiktoken under the hood, and every provider tokenizes differently. You'll get the right ballpark, not the exact invoice. For that, use the provider's own tools.
paste text or drop a file to start counting
Wait, where did my data go?
Notice something weird? There's no "Upload" button. No "Processing..." bar while your text travels to a server. You didn't even have to log in.
If you unplugged your internet right now, this tool would still work.
That's a deliberate architectural choice. When I built this, I had to decide where the "brain" of this tool should live. Most websites choose the Server Path: you send them your data, they process it on their computers, and send you the answer. I chose the Client Path: I send the logic to your browser, and your computer does the heavy lifting.
The Architect's Lesson: Why build it this way?
Privacy — I don't want your data
If you're checking the cost of a sensitive project prompt, I shouldn't see it. Your text never leaves your machine. I can't read it, I can't store it, and I can't get hacked for it.
The "Infinite Scale" Hack
If 10,000 people use this tool at once, my server costs stay at exactly $0. Instead of paying for a "supercomputer" server, I'm using the CPU power you already paid for when you bought your laptop. It's the ultimate way to build a "free" tool that stays free.
Speed — Zero Latency
Sending 3MB of text across the ocean to a server takes time. Doing the math on your own hardware is nearly instant. Your computer is faster at counting its own text than any server-trip could ever be.
So, why are these "estimates"?
This tool uses tiktoken, OpenAI's tokenizer, to count tokens. It's the gold standard for GPT models. But Anthropic, Google, and xAI each use their own tokenizers — different "dictionaries" that split text into slightly different pieces.
For example, Anthropic's tokenizer tends to use more tokens for the same text because it uses smaller "puzzle pieces" to better understand code and complex formatting. Google's SentencePiece system counts spaces and special characters differently.
The counts here are typically within ±10-15% of the real count. For budgeting purposes? That's more than good enough. For exact billing? Use each provider's official tokenizer or API.
The "Cost" Lie
The "Estimated Cost" you see is just that — an estimate. Providers charge for Input (what you send) and Output (what the AI says back). This tool measures Input, and lets you estimate Output with the multiplier above.
Pro Tip: When budgeting, always assume output will be 2-3x your input size. Don't just plan for the prompt — plan for the answer.
I built this because I wanted a tool that didn't snoop on my prompts. Open your browser's DevTools → Network tab. Paste text. Watch. Nothing leaves. That's the whole point.