DevKits

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:

Comments

Separate 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.

Total: 112 tokens · $0.000280 input cost
419 chars · 13 lines
Segment 125 tok · 22.3% · $0.000063

You are an expert technical writer. Follow the instructions exactly and never invent facts.

Segment 231 tok · 27.7% · $0.000077

Example 1: Input: "explain TCP" Output: "TCP is a connection-oriented protocol that guarantees ordered delivery."

Segment 328 tok · 25.0% · $0.000070

Example 2: Input: "explain UDP" Output: "UDP is a connectionless protocol with no delivery guarantees."

Segment 427 tok · 24.1% · $0.000068

Now write a two-sentence explanation of the following term, in the same style as the examples above:

Segment 51 tok · 0.9% · $0.000002

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

  1. 1Pick a model to set the token ratio and input price.
  2. 2Paste your prompt, separating each logical part with a blank line.
  3. 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

Reference & Guides