Paste some text into a token size calculator, read the number, close the tab. That is how most teams treat it — as a curiosity. The number is not a curiosity. It is the unit that governs both what a request costs and how long it takes to stream back. The divergence shows up the moment you build a real-time feature. A prompt that comfortably fits a model’s context window can still blow a streaming latency budget, because generation time scales with the number of output tokens, not the number of characters in the prompt. Teams that size prompts and outputs in tokens up front can hold a per-target latency budget. Teams that estimate in words or characters find out about the mismatch under load, when a chatty response stalls the interface a user is watching. What does working with a token size calculator involve in practice? A token size calculator runs the model’s tokenizer over your text and reports how many tokens it produced. That is the whole mechanism — but the mechanism is where the misunderstanding lives. The calculator is not counting words, and it is not counting characters divided by some fixed ratio. It is applying a specific subword vocabulary that was learned during the model’s training, and the count depends entirely on which vocabulary that is. For English prose, a common rule of thumb is that a token averages roughly four characters, or about three-quarters of a word (observed pattern across common tokenizers; not a fixed law). That heuristic is fine for a back-of-envelope estimate and dangerous for a budget. Code, JSON, non-Latin scripts, and rare proper nouns all tokenize far less efficiently — a UUID or a stretch of minified JSON can burn several tokens where you expected one. If your workload is document extraction or structured output rather than chat, the word-count heuristic will underestimate you, sometimes badly. The practical meaning is that a token count is a per-model, per-input measurement. To use it for planning, you need the tokenizer that matches your target model, run over inputs that look like your real traffic. Our walkthrough of how text becomes tokens for generative models covers the segmentation step in detail; this article is about what you do with the number once you have it. Why do tokens — not words or characters — determine inference cost and latency? Two independent reasons, and they compound. On cost: most hosted inference APIs bill per token, split into input and output rates, not per API call. A request that sends a 2,000-token prompt and receives a 500-token completion is billed for 2,500 tokens against two different unit prices — and output tokens are usually priced higher than input tokens. If you estimate spend by counting requests, you will be wrong by whatever the average token load turns out to be, which is exactly the quantity you failed to measure. Per-request cost is a function of token counts, not call counts, and the two rarely track each other. On latency: an autoregressive model generates one token at a time. Total generation time is, to a first approximation, the output token count divided by the model’s throughput in tokens per second, plus the time to the first token. Prompt length affects the prefill phase and the first-token delay; output length dominates the streaming phase. This is why a verbose response hurts more than a long prompt — the prompt is processed largely in parallel during prefill, while the output is produced serially. Reasoning models make this sharper still, because their hidden “thinking” tokens count against generation time even when the user never sees them. Reading a real latency-and-throughput profile, as in our analysis of the DeepSeek R1 benchmark for real-time GenAI, makes the tokens-per-second dependence concrete. Both effects point at the same lever: the output token count is the variable you control that most directly moves both the bill and the clock. How does tokenization differ across models, and why can the same text yield different token counts? The same sentence can produce meaningfully different token counts on two different models, because the tokenizer is part of the model, not a shared utility. The two dominant families are byte-pair encoding (BPE), used by the GPT family and many open-weight models, and SentencePiece, used by models in the LLaMA and T5 lineages. They differ in how they treat whitespace, how they handle bytes that fall outside the learned vocabulary, and how aggressively they merge frequent subword pairs. The consequence for planning is direct: a token size calculator built for one tokenizer gives you the wrong number for another model. A prompt budgeted at 1,800 tokens on an OpenAI tokenizer might land at 2,000-plus on a SentencePiece model of similar capability. Vocabulary size matters too — a larger vocabulary tends to represent common text in fewer tokens but costs more memory in the embedding table. Tokenizer family Used by (examples) Planning implication BPE (tiktoken-style) GPT family, many open-weight models Efficient on English prose; code and rare tokens inflate counts SentencePiece LLaMA, Mistral, T5 lineages Whitespace handled differently; same text often counts higher than BPE WordPiece BERT-era encoders Rarely on the generative critical path, but appears in retrieval components The rule that survives contact with production: budget with the exact tokenizer of the model you will ship, and re-check every time you change models. Switching from one model to another is not just a quality and cost change — it silently re-scales every token budget you set. How do input and output token counts map to a first-token and full-response latency budget for streaming GenAI? Split the user-perceived latency into two phases and budget them separately. The first is time-to-first-token (TTFT) — how long the user waits before anything appears. TTFT is driven by prefill: the model processes the whole prompt before it emits the first output token, so a longer prompt pushes TTFT up. For a streaming chat interface, TTFT is the number that determines whether the experience feels alive or dead. The second is the streaming phase — how long the full response takes to finish once it has started. This is governed by output token count against the model’s per-request generation rate (tokens per second). A response capped at 200 tokens on a model sustaining, say, 40 tokens/sec finishes the visible stream in about five seconds; the same model asked for 800 tokens takes four times as long. These are illustrative arithmetic, not a benchmark of any specific deployment — the point is the linearity, not the constants. Worked example: sizing a streaming response against a budget Assume a customer-support assistant with these targets and measured inputs: UX target: first token within 1 second; full response within 6 seconds. Measured throughput (from your own load test): TTFT ≈ 0.6 s at a 1,500-token prompt; sustained generation ≈ 45 tokens/sec on the target hardware (benchmark — your load test, not a vendor figure). Question: what output token cap keeps the full response inside 6 seconds? Budget arithmetic: 6 s total − 0.6 s TTFT = 5.4 s of streaming. At 45 tokens/sec, that clears roughly 240 output tokens. So an output cap around 240 tokens holds the full-response budget with a little headroom. If product wants longer answers, something has to give: a faster model or hardware, a higher throughput configuration, or a UX that keeps streaming past 6 seconds with a progress affordance. Notice what this makes visible. The prompt length set the TTFT slice; the output cap set the streaming slice; throughput converted tokens into seconds. None of that is reachable from a character count. How do you set a sensible output token cap without truncating meaningful responses? A hard max_tokens cap that is too low produces the worst failure mode of all: an answer that stops mid-sentence. The cap is not a substitute for controlling how long the model wants to talk — it is a safety rail, and the two must be set together. The workable approach has three moves. First, shape the expected output length with the prompt and the system instruction — ask for concision explicitly, specify a format, and the model’s natural output distribution shifts down. Second, measure the actual output-length distribution on representative traffic rather than guessing; set the cap above the 95th percentile of desired responses so the rail only ever catches runaways, not legitimate answers. Third, when a response does hit the cap, detect it (the finish reason tells you) and handle it deliberately — continue, summarize, or surface a “show more” — rather than shipping a truncated string. For reasoning models, keep a separate mental budget for hidden thinking tokens, because they consume generation time and, on many APIs, cost, without appearing in the visible answer. A cap set only against visible output will be surprised by the invisible portion. How can token estimates validate a streaming latency budget against target hardware throughput before shipping? This is where token sizing stops being a spreadsheet exercise and becomes an engineering gate. The token counts you estimate are only useful against a real throughput number, and throughput is a property of the executor — the model plus its serving stack plus the hardware — not of the model alone. The same weights on the same GPU can deliver very different tokens/sec depending on batching, KV-cache reuse, quantization, and the runtime. That means the honest way to validate a latency budget is to run your estimated token distribution through the actual serving stack under realistic concurrency and read the tokens/sec and TTFT that come back. Throughput is the output of latency-optimisation work — techniques like KV-cache reuse, described in our work on hierarchical caching for low-latency LLM inference, move the tokens/sec number that your token budget divides into. Routing cheaper queries to smaller models, as in query routing for lower-cost, low-latency LLM inference, changes both the per-token cost and the throughput a given request sees. And the per-request economics — how token counts turn into a production bill — are the subject of our breakdown of DeepSeek inference cost in production. This validation loop is exactly the streaming variant of a GenAI feasibility audit: the token estimates feed the audit’s streaming budget so the target UX is checked against realistic tokens/sec, not character counts. If you are scoping a real-time generative feature, our [generative AI engineering practice](generative AI) treats token sizing as the first input to the latency budget, not an afterthought. FAQ What should you know about a token size calculator in practice? It runs the target model’s tokenizer over your text and reports the token count — it is not counting words or characters by a fixed ratio. Because the count depends on the specific subword vocabulary, a valid estimate requires the tokenizer that matches your model, run over inputs that resemble real traffic. The number it returns is the planning unit for both cost and latency. Why do tokens — not words or characters — determine inference cost and latency? Most APIs bill per input and output token rather than per call, so cost tracks token counts, not request counts. Latency is bounded by output token count divided by the model’s tokens-per-second throughput, plus time-to-first-token from prefill. Both the bill and the clock are functions of tokens, and output length dominates the streaming phase. How does tokenization differ across models, and why can the same text yield different token counts? BPE (GPT-family, many open-weight models) and SentencePiece (LLaMA, T5 lineages) handle whitespace, out-of-vocabulary bytes, and subword merges differently, so the same text can count higher on one than the other. A calculator built for one tokenizer gives wrong numbers for another model. The safe rule is to budget with the exact tokenizer you will ship and re-check whenever you switch models. How do input and output token counts map to a first-token and full-response latency budget for streaming GenAI? Split perceived latency into time-to-first-token — driven by prompt length during prefill — and the streaming phase, driven by output token count against the model’s tokens/sec rate. Budget the two slices separately: prompt length sets TTFT, output length sets streaming duration, and throughput converts tokens into seconds. A character count cannot reach any of these. How do you set a sensible output token cap without truncating meaningful responses? Treat the cap as a safety rail, not a length controller: shape expected length with prompt and system instructions, measure the real output-length distribution on representative traffic, and set the cap above the 95th percentile of desired responses. Detect cap hits via the finish reason and handle them deliberately rather than shipping a truncated answer. For reasoning models, keep a separate budget for hidden thinking tokens. How can token estimates be used before shipping to validate a streaming latency budget against target hardware throughput? Run your estimated token distribution through the actual serving stack under realistic concurrency and read the tokens/sec and TTFT it returns, because throughput is a property of the executor — model plus serving stack plus hardware — not the model alone. This is the streaming variant of a GenAI feasibility audit: token estimates feed the streaming budget so the UX is validated against realistic throughput, not characters. Token sizing is where a real-time GenAI feature either survives contact with load or gets discovered too late. If you can name the tokenizer, the output cap, and the tokens/sec your executor sustains, you can hold a latency budget on purpose. The open question for most teams is not the arithmetic — it is whether the throughput number they divide into is measured on the executor they will actually ship, or borrowed from a spec sheet.