AI Token & Cost Calculator

Paste your prompt, codebase, or document to estimate token size and calculate exactly how much it will cost to run through popular LLM APIs.

0
Estimated Tokens
0
Word Count

Estimated API Cost (Input Prompt)

ModelProviderRate (per 1M inputs)Cost for 0 tokens
GPT-4oOpenAI$5.00$0.00000
GPT-4o-miniOpenAI$0.15$0.00000
Claude 3.5 SonnetAnthropic$3.00$0.00000
Claude 3 OpusAnthropic$15.00$0.00000
Claude 3 HaikuAnthropic$0.25$0.00000
Gemini 1.5 ProGoogle$3.50$0.00000
Gemini 1.5 FlashGoogle$0.07$0.00000

* This is an estimation based on standard English heuristics (1 token ≈ 4 chars). Actual billing depends on the exact tokenizer used by the provider (e.g., tiktoken for OpenAI).

What is an AI Token?

Large Language Models (LLMs) like ChatGPT and Claude do not read words the way humans do. Instead, they break text down into "tokens." A token can be a single character, a part of a word, or an entire word. As a general rule of thumb for English text, **1 token is approximately 4 characters** or **0.75 words**.

Why calculate API costs?

When you build an AI application or use tools like OpenAI's API or Anthropic's API, you are billed based on the number of tokens you send (Input Tokens) and the number of tokens the AI generates (Output Tokens). If you are passing large documents, entire codebases, or complex system prompts, these costs can add up extremely fast. This tool helps developers and founders estimate pricing before running large batches.

100% Client-Side Privacy

We know you are pasting sensitive codebases, proprietary prompts, or confidential documents to estimate their size. This calculator operates entirely in your browser using JavaScript heuristics. Your data is never sent to a server.