Prompt Token Breakdown (See which part costs the most)
Break a prompt into segments and see how many tokens — and how much cost — each part uses. Find the heaviest section (system, few-shot examples, or user input) so you know exactly what to trim. 100% local.
Last updated:
CommentsSeparate the parts of your prompt with blank lines and this tool shows the token count, percentage share, and cost of each segment — so you can see exactly which part (system, examples, or user input) is eating your token budget. Runs locally.
You are an expert technical writer. Follow the instructions exactly and never invent facts.
Example 1: Input: "explain TCP" Output: "TCP is a connection-oriented protocol that guarantees ordered delivery."
Example 2: Input: "explain UDP" Output: "UDP is a connectionless protocol with no delivery guarantees."
Now write a two-sentence explanation of the following term, in the same style as the examples above:
QUIC
Token counts are statistical estimates (±3% vs. official tokenizers) and run entirely in your browser — your prompt is never uploaded. Prices are indicative input rates per 1M tokens.
What is Prompt Token Breakdown?
On a long prompt, the total token count tells you what you'll pay but not where it went. Usually one section quietly dominates — a bloated system message, five verbose few-shot examples, or a pasted document. A prompt token breakdown splits the prompt into segments, estimates each segment's tokens and its share of the whole, and prices it against the selected model. That turns 'my prompt is 4,000 tokens' into 'the examples are 3,100 of them' — an actionable insight for cutting cost and latency without hurting output quality.
How to break down a prompt
- 1Pick a model to set the token ratio and input price.
- 2Paste your prompt, separating each logical part with a blank line.
- 3Read the per-segment bars: the longest is your best target for trimming.
Use Cases
Cut API cost
Find the heaviest segment and compress it — often few-shot examples that can be halved with no quality loss.
Optimize latency
Fewer input tokens means faster time-to-first-token; the breakdown shows where the fat is.
Key Concepts
- Few-shot examples
- In-context examples that guide the model — often the biggest token cost.
- Token cost
- Input tokens × price per million. Compare model prices side by side.
Frequently Asked Questions
How does it decide the segments?
It splits your prompt on blank lines. Separate the system instructions, each few-shot example, and the user input with a blank line to see the token share of each part.
Why break a prompt down at all?
On long prompts, one section (often few-shot examples or a pasted document) quietly dominates the token count. Seeing per-segment share tells you exactly where to cut to reduce cost and latency without hurting quality.
Is the prompt uploaded?
No. Token counting runs locally in your browser; your prompt text never leaves the tab.
Try Next
LLM JSON Extractor
Extract every JSON object or array buried inside an LLM reply — even when it's wrapped in markdown fences, mixed with explanation text, or has trailing commas and single quotes. Auto-repairs each block. 100% local.
Related Tools
Batch API Cost Calculator
Compare real-time vs Batch API cost for a bulk job. Enter request count and per-request tokens to see how much the ~50% batch discount saves across models that support it. 100% local.
Prompt Injection Detector
Scan untrusted user input for common prompt-injection and jailbreak patterns — instruction overrides, jailbreak personas, system-prompt exfiltration — with a risk score. Heuristic, 100% local.
Text Chunker
Split long text into overlapping chunks for embedding and RAG pipelines. Preview recursive, paragraph, sentence, or fixed strategies with live token counts. Runs 100% in your browser.
Cosine Similarity
Compute cosine similarity, dot product, and Euclidean distance between two vectors online. Perfect for debugging LLM embeddings, semantic search, and RAG pipelines. 100% local — vectors never leave your browser.
AI Cost Calculator
Estimate monthly LLM API cost across GPT-4o, Claude 3.5, Gemini, DeepSeek and 100+ models. Compare providers side-by-side with prompt-caching and batch discounts. Free, no signup — prices refreshed daily from the public LiteLLM catalog.
Token Counter
Count tokens in your prompt for GPT-4, GPT-3.5, Claude, and Gemini and predict API cost before you spend. Free, no signup — all counting runs locally, your prompt stays in your browser.