LLM Token Counter & Cost Estimator

Estimate how many tokens your text will use in an LLM prompt, see live word and character counts, and calculate estimated API cost with an editable price-per-million-token field.

Files never leave your device
Back to Tools
This tool is being ported to the new interface and will be back shortly.
  1. Paste or type your prompt, document, or any text into the input box.
  2. See the estimated token count update instantly alongside word and character counts.
  3. Pick a reference model from the dropdown to auto-fill a representative $/1M-token price, or type your own price directly.
  4. Read the estimated cost for that text at the given price point — adjust the price any time to match your provider's current rate.

All processing happens entirely in your browser. Your data never leaves your device.

Key Features

  • Instant token estimate using the standard ~4 characters-per-token approximation
  • Live character and word counts alongside the token estimate
  • Reference model dropdown with representative $/1M-input-token price points
  • Fully editable price field so your cost estimate never goes stale
  • Cost calculation updates instantly as you type or change the price
  • One-click copy of the token count
  • Clear on-screen disclaimer that this is an estimate, not exact tokenization
  • 100% client-side — your prompt text is never uploaded anywhere

About LLM Token Counter

Large language models process text as "tokens" — pieces of words, not individual characters — and nearly every LLM API bills by the token, not by the character or word. Knowing roughly how many tokens a piece of text will consume is essential for staying within context limits and estimating API costs before you send a request.

Real tokenization is model-specific and requires the exact tokenizer (like OpenAI's tiktoken or Anthropic's tokenizer) that produced that model's vocabulary — none of which can run as a lightweight client-side library without shipping a large vocabulary file. Instead, ForgeKit's Token Counter uses the widely-cited approximation of roughly 4 characters per token, which tracks reasonably closely with GPT-family English-language averages for typical prose and code.

This is clearly an estimate for planning purposes, not an exact count — actual tokenization varies by model, language, and content type (code and non-English text often tokenize differently than English prose). Alongside the estimate, the tool includes a cost calculator with a few representative reference price points that you can freely edit, since API pricing changes frequently and a hardcoded number would quickly go stale.

Frequently Asked Questions

No — this is explicitly an estimate. It uses the common approximation of about 4 characters per token, which is a reasonable rule of thumb for English text but not an exact match for any specific model's real tokenizer. For exact counts you would need that model provider's actual tokenizer library.

Real tokenizers require loading a large model-specific vocabulary file, and different LLM providers use different tokenizers entirely. Shipping and maintaining all of them client-side isn't practical for a lightweight browser tool, so this uses the standard character-based approximation instead and says so clearly.

API pricing changes often, and hardcoding exact prices would make the tool inaccurate over time. Selecting a model fills in a representative reference price as a starting point, but the field stays fully editable so you can enter your provider's current published rate.

The tool estimates tokens for whatever text you paste in — typically your input/prompt text. If you want to estimate cost for expected output as well, paste a sample of the expected response text separately, since input and output are often priced differently.

No. The character, word, and token estimates are all computed locally in your browser using simple JavaScript string operations. Nothing is uploaded to any server or API.