🧮

Token Usage Calculator

🔒 In your browser

Count tokens in text and estimate model cost.

Exact for OpenAI GPT-4/4o encodings (o200k). Claude & Gemini use different tokenizers (not public), so their counts are close approximations.

Disclaimer: Estimates for informational purposes only. Pricing and performance figures come from a community-maintained feed (LiteLLM) with bundled fallbacks and may be outdated or inaccurate. Always confirm current prices on the official OpenAI, Anthropic, Google, or cloud-provider pricing pages before making decisions. ToolsHub is not affiliated with these companies; product names are trademarks of their owners. Token counts for non-OpenAI models are approximate.

About the Token Usage Calculator

LLMs measure text in tokens, not words, and cost scales with token count. This free token counter counts the exact number of GPT tokens in your text using a real tokenizer, and estimates the cost for any model — so you can size prompts and budgets precisely.

Counting happens in your browser; your text isn't uploaded.

How to count tokens

  • Paste your text.
  • See the exact token count from a real GPT tokenizer.
  • Estimate the cost for your chosen model.

Why token counts matter

Language models bill per token, not per word, and a token is roughly four characters or three-quarters of an English word. Long prompts, big system messages and verbose outputs all add up — and a prompt you send on every request multiplies fast at scale. Counting tokens before you ship lets you size context windows and estimate cost accurately instead of guessing.

Frequently asked questions

What is a token?

A token is a chunk of text — roughly 4 characters or three-quarters of a word in English — that language models use as their unit of input and output, and of billing.

How many tokens is a word?

On average about 1.3 tokens per English word, but it varies with punctuation, spacing and language. This tool counts exactly rather than estimating.

Is my text private?

Yes. Tokenization runs locally in your browser and your text is never uploaded.

How many tokens is a word?

About 1.3 tokens per English word on average, but it varies with punctuation, spacing and language. This tool counts exactly with a real tokenizer rather than estimating.

Related searches

token countertoken calculatorcount tokenstiktoken onlinegpt token counterllm token usagetokens to cost

Learn more

Related Calculators tools

🔗 Embed this tool on your website — free

Copy this and paste it into your page's HTML. The tool runs in the visitor's browser, just like here. Change height to fit, or add the optional auto-resize snippet below. Add ?theme=dark to the URL for dark mode.

<iframe src="https://toolhq.dev/embed/token-usage-calculator/" title="Token Usage Calculator — ToolsHub" width="100%" height="520" style="border:1px solid #e5e7eb;border-radius:12px;max-width:680px" loading="lazy"></iframe>
Optional: auto-resize the iframe height

Add this once on the same page so the iframe grows to fit the tool:

<script>
addEventListener("message", function (e) {
  if (e.data && e.data.type === "toolshub:resize") {
    document.querySelectorAll('iframe[src*="/embed/"]').forEach(function (f) {
      if (f.contentWindow === e.source) f.style.height = e.data.height + "px";
    });
  }
});
</script>