Developer Tools

What Happens to Your Prompt When You Use an Online Token Counter

12 min read
Count tokens without the cloud

You paste a prompt into a web-based token counter and get a number back. Clean, fast, done. But between the paste and the result, your prompt, with its system instructions, API keys, proprietary logic, maybe even customer data, travels to a server you don’t control, where a third-party logging system stores it and un-audited code processes every variable. Most developers never think about this. They should. This post breaks down exactly what happens to your text when you use a conventional online token counter, why the privacy implications are worse than most people assume, and how to count tokens, estimate costs, and check context window fit across 37 AI models. All without your prompt ever leaving your browser.

Where Your Prompt Actually Goes

Most web-based token counters work by sending your text to a server-side API. Your prompt is transmitted over HTTP, processed on someone else’s machine, and the token count is sent back. That’s the same architecture as the AI APIs you’re trying to estimate costs for. You’re sending sensitive data to a third party just to find out how much sending sensitive data to another third party will cost.

The privacy policy might say “we don’t store your data.” You have no way to verify that. Logs exist on every hop between you and the server: the hosting provider’s access logs, the CDN’s edge logs, any reverse proxy in front of the application. Even if the service genuinely deletes your prompt after processing, it existed in memory on a machine you don’t own, in a jurisdiction you may not know, subject to a privacy policy you probably didn’t read.

TLS encrypts the connection, but the server still sees your plaintext prompt. It has to, to count the tokens. And even “client-side” token counters that claim to run in your browser often use a simplified tokenizer that undercounts, giving you a false sense of security with inaccurate numbers. You think you’re at 80% of the context window. You’re actually at 95%.

Your Prompt Leaves the Browser

Every online token counter that gives you an instant, accurate result is either sending your text to a server or running a simplified approximation client-side that undercounts. Historically, developers believed accurate client-side tokenization was impossible without massive server-side libraries. Modern client-side architectures have bypassed this limitation by running model-specific vocabularies and BPE scripts directly in-browser via compiled WebAssembly, which is exactly how CapyToolkit avoids server dependencies entirely.

Server-side processing means your prompt exists in memory on a machine you don’t own. The server has to read every character to produce an accurate count. Before you hit “submit,” your browser has already leaked a surprising amount of information to the server, and that’s separate from the prompt text itself. See exactly what your browser leaks to every server you connect to. The fingerprint data alone can identify you across sessions, even without cookies. MDN defines fingerprinting as collecting and combining browser and operating-system features through JavaScript and CSS to create a unique browser fingerprint for tracking.1 MDN’s how browsers collect fingerprinting signals explains how JavaScript APIs collect enough signal to uniquely identify most visitors without any cookies at all.

What They Can See

System prompts often contain proprietary instructions, internal tool names, customer data schemas, API keys, database connection strings. Even “harmless” prompts reveal your tech stack, your architecture, your business logic, enough for a competitor to reverse-engineer your approach. RAG context pasted into a token counter might contain internal documentation, support tickets, or customer PII.

Scrub sensitive data before sending prompts to ChatGPT or any other AI provider. The PII Scrubber detects and tokenizes emails, API keys, IP addresses, and 19 other data types locally. Your real data never reaches the AI server. But the real solution is simpler: don’t send your prompt to a third-party token counter in the first place. Count locally, then paste into your IDE or API.

What the Token Counter Shows Before You Paste

Operating entirely within the local execution context of your browser tab, count tokens and compare AI model costs directly in your browser parses your prompt without ever transmitting a single byte across the network. It works offline with no network connection required: disconnect from the internet after loading the page and it still works. Paste once to see token counts and costs for all 37 models simultaneously, from GPT-5.5 to Qwen3.5 397B, from Opus 4.8 to Sonar Pro.

The context window column shows each model’s total window size alongside your usage percentage. Amber warning at 75%, red at 95%. Live pricing updates daily from a database, but the application fetches these prices via a separate, anonymous request. Your prompt content is never part of it. This is the workflow: count tokens, check context fit, compare costs, and only then paste into your IDE, chatbot, or API.

Compare AI model costs by token count before you commit to a provider. The difference between models isn’t just quality. It’s a 5x to 20x difference in cost for the same prompt.2

Context Window at a Glance

The context column displays each model’s total context window size next to your usage percentage. Context windows vary wildly: 128K on Qwen3.5 397B, 1M on GPT-5.5 and Gemini 3.1 Pro, 262K on Qwen3.6 35B.3 Before this update, you’d count tokens in the counter, then tab to the provider’s docs to check if you’re near the limit. Now it’s one screen.

This matters because a prompt that fits in GPT-5.5’s 1M window might blow past Qwen3.5 397B’s 128K limit, and you won’t know until the API returns an error or, worse, silently truncates. Understand what happens when your prompt exceeds the context window: the API accepts your request, the model generates a response, but your prompt was cut off and you get an answer to a question you didn’t fully ask. Silent truncation is the worst outcome because you don’t know it happened.

Research on context window overflow in production AI systems confirms that silent truncation causes agents to lose critical instructions mid-task, producing incorrect results that cost more tokens to diagnose and fix than the original task.4

Flagship Models, One View

To help you compare execution models side by side, the following matrix tracks input and output costs alongside context limits for the top flagship providers:3

ModelInput $/MOutput $/MContext Window
GPT-5.5$5.00$30.001M
Claude Opus 4.8$5.00$25.001M
Gemini 3.1 Pro Preview$2.00$12.001M
Kimi K2.6$0.75$3.50256K
GLM-5.2$1.40$4.401M
Qwen3.5 397B$0.39$0.90128K
DeepSeek V4 Pro$0.44$0.871M
Grok 4$3.00$15.00256K

GPT-5.5 carries the highest output cost at $30/M and a modest $5/M input rate, while its 1M context window handles the longest prompts.5 Claude Opus 4.8 sits at $25/M output, the reasoning flagship with top-tier benchmark scores.6 Kimi K2.6 and GLM-5.2 are the value contenders: competitive performance at a fraction of the cost of the US big three. DeepSeek V4 Pro offers an open-weight alternative with strong coding benchmarks. The point isn’t to compare benchmarks. It’s to show that whatever model you’re using, you can estimate the cost of your specific prompt before you ever hit “send.”

Model Families Covered, All 37

The counter’s coverage spans fifteen distinct providers. Within the OpenAI family, the engine supports GPT-5.5 and the GPT-5.4 series, while Anthropic developers can audit Claude Opus 4.8, Sonnet 4.6, and Haiku 4.5. For Google’s ecosystem, the tool maps Gemini 3.1 Pro Preview, Flash-Lite, and 3.5 Flash, alongside Alibaba’s Qwen3.6 35B and Qwen3.5 397B. Moonshot brings Kimi K2.6 to the table, and Zhipu AI covers the GLM-5.2 and GLM-5.1 series. DeepSeek’s V4 Pro and V4 Flash are fully represented, with xAI’s Grok 4, Grok 4.3, and Grok Code Fast rounding out the flagship lineup. MiniMax, Mistral, Amazon (Nova Premier, Pro), Nvidia (Nemotron 70B, 3 Super 120B), and Perplexity (Sonar Pro) fill in the long tail.

All 37 models update live with daily pricing. No need to check five different pricing pages or maintain a spreadsheet. Paste once, see everything. For teams evaluating model switches, this is the difference between a 10-minute research task and a 30-second glance.

The breadth matters more than it sounds. A prompt that costs $0.04 on GPT-5.5 might cost $0.002 on DeepSeek V4 Pro, a 20x difference. If your workload is 10,000 requests per day, that’s the gap between $425 and $21 daily. The counter makes this visible before you commit to a provider, not after you’ve already built your pipeline around one.

That workflow keeps cost decisions and data handling inside CapyToolkit’s free browser-based tools that run locally, so teams can standardize before prompts reach production.

Before You Paste, A 30-Second Checklist

Follow this workflow before every API call that matters:

  1. Open the token counter. It works offline, no account, no install. It’s a static page.
  2. Paste your prompt. All 37 models update instantly with exact token counts.
  3. Check the context bar. Amber means you’re at 75% of that model’s window. Red means 95%.
  4. Compare input costs across models for your specific prompt length. The difference between GPT-5.5 and a value model can be 20x or more.
  5. Estimate full round-trip cost: input $ + (expected output tokens x output $/M).
  6. Only now paste into your IDE, chatbot, or API, with full knowledge of cost and fit.

This takes 30 seconds. For teams, it’s the difference between a $50/month API bill and a $500 one. Knowing your prompt cost before you send it changes behavior. You start routing simple tasks to cheaper models, compressing prompts that are bloated, and catching context overflow before it becomes a production incident. Over time, this workflow also builds intuition: you start recognizing which prompts are too long, which models are overkill for a given task, and where the cost bottlenecks actually are. Analyze your API response logs locally afterward to verify you got what you paid for.

Cost Estimation in Practice, What Your Prompts Actually Cost

A real-world example: a 2,000-token system prompt with 500 tokens of user input, expecting 1,000 tokens of output. On GPT-5.5, that’s ($5/M x 2,500 / 1,000,000) + ($30/M x 1,000 / 1,000,000) = $0.0125 + $0.03 = $0.0425 per call. On DeepSeek V4 Pro, the same prompt costs ($0.44/M x 2,500 / 1,000,000) + ($0.87/M x 1,000 / 1,000,000) = $0.0011 + $0.00087 = $0.0020 per call. That’s roughly 20x cheaper for identical input and output.

Scale this to 1,000 calls per day. The difference between GPT-5.5 and DeepSeek V4 Pro adds up fast: at $0.0425 per call on GPT-5.5 versus $0.0020 on DeepSeek V4 Pro, that’s $42.50/day versus $2/day. Over a month, the gap exceeds $1,200. At 10,000 calls per day, you’re looking at $425/day on GPT-5.5 versus $20/day on the value model, and the token counter shows you these numbers before the bill arrives, not after.

The math is straightforward, but most developers never do it. They pick a model, send prompts, and check the bill at the end of the month. By then, the overspend is already locked in. What changes the equation is seeing the per-call cost in real time, right next to the prompt you’re about to send. When you can see that your specific 3,000-token prompt costs $0.045 on one model and $0.002 on another, routing decisions become obvious.

Why Offline Matters More Than You Think

“But I only paste harmless prompts.” System prompts, RAG context, and few-shot examples contain your proprietary logic. Enterprise teams shipping to production can’t paste internal prompts into third-party web tools. It’s a data breach waiting to happen, and it likely violates their own security policy. OWASP’s LLM prompt injection guidance lists unauthorized data access and exfiltration, system prompt leakage, and sensitive information disclosure as key impacts of prompt injection attacks.7 OWASP’s how prompt injection exposes sensitive information lists sensitive information disclosure as one of the top risks in LLM applications, and that includes data exposed to intermediate services like token counters.

CapyToolkit’s architecture is a static HTML page. No backend. No database. No analytics on your input. The JavaScript runs in your browser and nowhere else. The live pricing data is fetched as a separate, anonymous request. Your prompt content is never part of it. This is the same zero-cloud architecture across all 30+ browser-based tools. The token counter isn’t an exception. It’s the standard. Every tool on the site, from PII scrubbers to log explorers, runs on the same principle: your data stays on your device.

If your threat model includes “don’t send my prompts to random servers,” and it should, then the choice of token counter matters as much as the choice of AI provider. Every prompt you paste into someone else’s web tool is a data transfer you can’t undo. The same zero-cloud principle that keeps your files local in CapyTools’ other 30+ tools applies here: your prompt is your data, and it should stay on your machine until you decide otherwise. Treating cost estimation and context validation as an offline-ready pre-flight habit turns security from a policy checklist into a natural developer reflex. By processing every prompt locally before it ever hits a network socket, you reclaim absolute ownership over your proprietary code and customer data, ensuring that your variables move only when you decide to send them, entirely on your terms.

Sources
  1. 1.

    “Device fingerprint,” Wikipedia, accessed August 2026. https://en.wikipedia.org/wiki/Device_fingerprint

  2. 2.

    Google, “Gemini API Pricing,” ai.google.dev, accessed June 2026. https://ai.google.dev/gemini-api/docs/pricing.md.txt

  3. 3.

    Google, “Gemini 3.1 Pro Preview | Gemini API | Google AI for Developers,” ai.google.dev, April 2026. https://ai.google.dev/gemini-api/docs/models/gemini-3.1-pro-preview

  4. 4.

    Anthropic, “Context windows,” platform.claude.com, accessed August 2026. https://platform.claude.com/docs/en/build-with-claude/context-windows

  5. 6.

    OpenAI, “GPT-5.5 Model | OpenAI API,” developers.openai.com, accessed June 2026. https://developers.openai.com/api/docs/models/gpt-5.5

  6. 7.

    Anthropic, “Models overview - Claude API Docs,” platform.claude.com, accessed June 2026. https://platform.claude.com/docs/en/about-claude/models/overview

  7. 5.

    OWASP Foundation, “LLM Prompt Injection Prevention Cheat Sheet,” cheatsheetseries.owasp.org, accessed June 2026. https://cheatsheetseries.owasp.org/cheatsheets/LLM_Prompt_Injection_Prevention_Cheat_Sheet.html

More in Developer Tools