TokenPad

How-to · 8 min · 7 steps

How to reduce token usage

Seven ways to cut token usage in LLM prompts, ordered by return on effort, with the arithmetic behind each and the one that backfires.

Published August 4, 2026

Token usage is the one input to your bill you fully control. These are ordered by what they return per hour of work, which is not the order they are usually attempted in.

One of them is a trap that raises the count while appearing to lower it. It is the last section.

  1. Measure before changing anything

    Get median input tokens, median output tokens and requests per month, broken down by endpoint. Teams that believe volume drives their bill usually discover one endpoint sending a whole document where a paragraph would do.

    LLM Token CounterReal BPE tokenization, not characters ÷ 4. Shows which counts are exact and which are estimates.
  2. Minify structured payloads

    Pretty-printed JSON spends two to four tokens per line on indentation that carries no information. Thirty to fifty percent on a nested payload, with zero quality risk. Keep the readable version in your logs.

    Prompt Token OptimizerCuts whitespace, minifies JSON, collapses blank lines. Shows tokens saved and the annual value.
  3. Change the serialisation format

    An array of five hundred objects repeats every key five hundred times. CSV states each field name once. On flat tabular data the spread between cheapest and dearest format is routinely three to one.

    Data Format Token ComparisonSame records, five formats, five very different token counts. Usually 50–70% is recoverable.
  4. Cut the system prompt

    It is billed on every request forever, and in a chat product on every turn. Price each paragraph annually and sort by cost, not by how wrong it feels — the expensive paragraph is rarely the one you suspected.

    System Prompt AnalyzerPer-section token breakdown and the yearly price of each paragraph you leave in.
  5. Constrain output length

    Output costs four to six times input. Set a realistic max_tokens rather than the model maximum, and ask for the format you want explicitly. "Reply in one sentence" is the cheapest optimisation on this list.

    max_tokens PlannerA ceiling derived from your p95, checked against window and quota.
  6. Retrieve fewer, better chunks

    Eight chunks of three hundred tokens is 2,400 tokens on every request. Reranking down to three or four cuts the largest line of a RAG bill and usually improves the answer, because irrelevant context degrades output.

    RAG Retrieval Budget CalculatorWhat retrieved context costs per month, and the k comparison table.
  7. Cap conversation history

    Every turn resends everything before it, so total input grows with the square of the turn count. Capping or summarising converts that back to linear.

    Chatbot Conversation Cost CalculatorHistory is resent every turn, so cost grows quadratically. Most budgets miss this entirely.

What goes wrong

Stripping spaces between words

This is the trap. In most byte-pair vocabularies the leading space is part of the word token — the encoder learned " the" as a unit, not "the". Removing word spacing forces it onto fragments and the token count goes up while the character count goes down. Structural whitespace is waste; word spacing is not.

Shortening variable names and removing punctuation

Saves a rounding error and makes the prompt worse. The gains are in structure and volume, not in micro-editing prose.

Frequently asked questions

How much can I realistically cut?
Forty percent is a normal first pass on a workload nobody has optimised. Beyond that you are trading quality, and the trade should be deliberate and measured.
Does reducing tokens hurt output quality?
The structural changes — minification, format choice, whitespace — do not, because the model receives the same information. Cutting examples or constraints does, so evaluate those separately.

Tools for this

Read next