AI & LLM Tools — Token Count, Pricing & Context
These utilities for LLM developers run in your browser. Count tokens, convert JSON to TOON for prompts, estimate API costs and check whether a prompt fits a context window. Two related tools: the word-counter and the json-formatter.
- Count tokens before calling OpenAI, Anthropic, or Google APIs.
- Estimate run cost from input/output token counts.
- Check whether a prompt fits a model context window.
LLM token counter
Count tokens locally with tiktoken, the exact encoding for OpenAI models.
LLM pricing calculator
Estimate API cost from input and output token counts.
Context window calculator
See how much of each model’s context limit a prompt uses.
Prompt optimizer
Analyze prompt structure, redundancy and token waste. Optionally rewrite the prompt with a local Qwen model.
JSON → TOON
Convert JSON to TOON and compare tokens and input cost against JSON.
TOON → JSON
Decode TOON to formatted JSON, with strict validation by default.
Guides

LLM API Cost: Batch API, Prompt Caching and Monthly Projection
Lower your OpenAI/Anthropic/Gemini bill: estimate input/output, model batch and caching in your calculations — verified rates, 100% local.

LLM Context Window: Size Your Prompts for GPT, Claude and Gemini
RAG, multi-turn agents, system prompts: calculate context-window usage and remaining headroom before calling the API.

When TOON Beats JSON for LLM Prompts (and When It Doesn't)
Honest guide: uniform tabular data, convert → count → price → context workflow; not a JSON/YAML replacement manifesto.

Count LLM Tokens and Estimate API Cost Locally (OpenAI, Claude, Gemini)
Before calling an LLM API: count tokens, estimate USD cost and check context-window fit — 100% in the browser without sending your prompt.