How to Use Fewer Tokens and Get Better LLM Results

You paste a long document into ChatGPT or Claude. The model responds with a summary that ignores the second half. Or worse, you hit a context limit and the conversation stalls entirely.

The instinct is to blame the model’s context window. The actual problem is usually simpler: the input is full of tokens that add nothing. Navigation menus copied alongside the article. Redundant formatting. Boilerplate that got dragged in with a copy-paste. Every wasted token displaces something useful.

This guide covers what actually consumes tokens, what you can cut without losing information, and when it is worth trimming at all. The goal is not to squeeze every last token. It is to reduce LLM token usage to the point where the model sees what matters and ignores what does not.

Why Tokens Matter More Than You Think

Tokens are the unit of everything in an LLM interaction. They determine three things at once.

Cost. If you use the API, you pay per token. A bloated prompt that sends 8,000 tokens when 2,000 would carry the same information costs four times as much. At scale, that is real money.

Context limits. Every model has a context window. Even models advertising 100K or 200K token windows degrade in quality well before they hit the ceiling. Research on long-context performance consistently shows that models attend most strongly to the beginning and end of their input. Content buried in the middle of a 100K-token prompt gets less attention than content placed in a focused 4K-token prompt.

Output quality. This is the one people underestimate. More input is not better input. When a model processes a prompt stuffed with irrelevant content, it splits its attention across all of it. A precise 1,500-token input regularly produces better answers than a sloppy 10,000-token input on the same question.

Using fewer tokens is not just about saving money or fitting under a limit. It makes the model’s output better.

What Actually Counts as a Token (And the Surprises)

A token is not a word and not a character. It is a chunk of text that the model’s tokenizer assigned its own ID during training. Common English words often map to a single token. Less common words, technical terms, and non-English text get split into multiple tokens.

A few things that catch people off guard:

Whitespace is not free. Blank lines, trailing spaces, and inconsistent indentation all cost tokens. A document with three blank lines between every paragraph uses measurably more tokens than one with a single blank line.

HTML markup is expensive. A <div class="article-body__content-wrapper"> tag is roughly 12 tokens. It carries zero information for an LLM. A typical web page has hundreds of these tags wrapping the content you actually care about.

Repetition adds up fast. Headers, footers, and boilerplate that appear on every page of a multi-page paste multiply across the input. If you paste five pages from the same site, you might be sending the same navigation menu five times.

Code tokenizes differently than prose. Special characters, brackets, and camelCase names often split into more tokens than the equivalent plain-English explanation. A 200-line code file can easily be 3,000+ tokens.

You do not need to obsess over individual tokens. But knowing what is cheap (common English words) and what is expensive (markup, special characters, repetitive boilerplate) changes how you think about what to include.

The Biggest Token Wasters

Some inputs waste tokens systematically. These are the ones worth catching before you hit send.

Web page boilerplate. If you copy an article from a website and paste it into an LLM, you are almost certainly including navigation bars, footers, cookie banners, sidebar widgets, and sometimes raw HTML or CSS. On a typical page, the actual content is 15 to 25 percent of what you pasted. The rest is structure that the browser needs and the LLM does not.

Redundant instructions. Pasting the same system prompt or context into every message in a long conversation is common and wasteful. Most chat interfaces carry the system prompt forward automatically. Repeating it doubles the token cost for no gain.

Verbose formatting from copy-paste. Content copied from Google Docs, Notion, or PDFs often brings invisible formatting along: non-breaking spaces, zero-width characters, excessive line breaks, embedded styles. It looks the same to you. The tokenizer sees extra work.

Full documents when you need a section. Pasting an entire 40-page PDF when your question is about page 12 is the single most common form of token waste. The model will try to process all 40 pages, but your question is about three paragraphs.

The fix for all of these is the same instinct: give the model what it needs for this specific question and nothing more.

Four Strategies for Long Documents

Sometimes the document is genuinely long and you need most of it. Here is how to handle that without blowing through your context window.

Chunk and query. Split the document into logical sections (by heading, by chapter, by page) and send each section with your question separately. Collect the individual answers, then ask the model to synthesize them. This is the manual version of what RAG pipelines do automatically, and for a one-off task, it works fine.

Summarize first, then drill. Send the full document and ask for a summary. Once you have the summary, send only that for detailed work. Two focused prompts beat one overloaded prompt.

Progressive disclosure. Give the model an outline or table of contents first. Ask which sections are relevant to your question. Then send just those sections. This works especially well with research papers, where the abstract and section headings are enough for the model to identify where the answer lives.

Strip before sending. Remove references, appendices, acknowledgments, and any section that is not relevant to your question. A 30-page paper with 8 pages of references becomes a 22-page paper that carries the same information for your purpose. The same applies to code: tests, config files, and boilerplate that are not relevant to your question do not need to be in the prompt.

For readers building automated systems rather than doing one-off pastes, the guide to preparing web content for RAG covers this at the pipeline level.

When Format Choice Matters (And When It Doesn’t)

There is a common claim that markdown is the best input format for LLMs. It is sometimes true. It is not universally true.

Markdown helps when structure matters. If the model needs to distinguish headings from body text, identify list items, or parse code blocks, markdown’s lightweight syntax communicates that structure in very few tokens. Raw HTML communicates the same structure in five to ten times more tokens.

Plain text is fine for prose. If you are feeding the model a long essay or a transcript and asking for a summary, there is no structural information to preserve. Clean plain text works as well as markdown and uses slightly fewer tokens because it does not have any formatting syntax at all.

Structured data benefits from structured formats. If your input is tabular data, JSON or CSV is usually better than a markdown table. Markdown tables are human-readable but not the most token-efficient way to represent rows and columns for a model.

The worst format is whatever you copied from a website without cleaning. Raw HTML with inline styles, script tags, and layout divs is the most token-expensive and least informative format you can send. Whatever you do, do not paste raw HTML.

The honest answer on format choice: pick the format that preserves the information the model needs for your specific task, and strip everything else. That is sometimes markdown, sometimes plain text, sometimes JSON, and never raw HTML.

Tools and Approaches That Reduce Token Usage Without Cutting Content

Several approaches cut tokens without removing information.

Clean before you paste. If your source is a web page, use a tool that extracts the content and strips the boilerplate. CopyMarkdown does this for web content specifically: one click converts a page to clean text without the nav bars, cookie banners, and scripts that inflate the token count. A page that costs 8,000 tokens as raw HTML typically drops to 1,000 to 1,500 tokens after extraction.

Use your model’s file upload when available. ChatGPT, Claude, and Gemini all support file uploads (PDF, text, code). The model’s built-in file handling often tokenizes and chunks the document more efficiently than a raw paste into the chat window.

Collapse what you can describe. If a code file has 200 lines of imports and configuration before the 30 lines you care about, describe the setup in a sentence (“This is a FastAPI app with SQLAlchemy models”) and paste only the relevant function. The model does not need to see every import to understand the function you are asking about.

Reuse context across turns. In multi-turn conversations, the model already has the prior context. Do not re-paste the document in every message. Refer to it: “In the document I shared above, what does section 3.2 say about…” works and costs almost nothing.

Tell the model to talk less. Everything above trims input tokens. This one trims output tokens, which are typically more expensive on most APIs. LLMs default to verbose, polite, over-explained responses. A three-paragraph preamble before the actual answer, a summary you did not ask for, hedging language on every sentence. All of it costs tokens.

Developers have started addressing this bluntly. Some prompt with “be extremely terse” or “skip all pleasantries.” Others go further: there is a growing practice of telling Claude or ChatGPT to “respond like a caveman,” stripping responses down to the bare minimum. It sounds absurd. It works. For tasks like code generation, data extraction, or classification where you need the answer and nothing else, terse prompting can cut output tokens by 50% or more. That is not a formatting trick. On a high-volume pipeline, that is half the bill.

When to Stop Trimming and Just Use a Bigger Model

Token optimization has diminishing returns. At some point, the time you spend trimming input costs more than the tokens you save.

If you are using the API at low volume, the math rarely justifies elaborate trimming. Processing a 10,000-token prompt through Claude Sonnet costs a fraction of a cent. Manual trimming that saves 5,000 tokens saves you half a fraction of a cent. Spend that time on a better prompt instead.

If you are running a pipeline at scale, trimming pays off fast. Processing 10,000 documents per day at 8,000 tokens each versus 2,000 tokens each is a 4x cost difference that compounds every day. This is where extraction and cleaning pipelines earn their keep.

If you are using a chat interface (not the API), you are not paying per token. Your cost is a flat subscription. The only reason to trim is quality, not price. If the model handles your full document well and gives good answers, the token count is irrelevant.

The rule of thumb: trim for quality first, trim for cost only at scale.

What to Read Next

If you want to step back from token tactics and look at the inputs themselves, our markdown vs DOCX vs PDF breakdown walks through what each format actually costs an LLM and which one to send for which workflow.

This post covered the input side of token efficiency. For readers building automated pipelines that process web content, the guide to preparing content for RAG picks up where section four left off.

For the broader question of how AI systems find and consume web content in the first place, llm.txt covers the emerging standard for making sites machine-readable at the structure level.