Messages JSON token breakdown
ClientPaste a chat API messages payload and get a per-message rough token table. Pair with JSON format if the file is minified.
Messages JSON
?
Expects a JSON object with a messages array (role + content). Multipart content arrays sum text parts only. Counts are heuristic—not billing-grade.
Total: ~48 tokens · 190 characters · 3 messages
| # | Role | ~Tokens | Chars | Preview |
|---|---|---|---|---|
| 0 | system | 11 | 43 | You summarize pasted logs in three bullets. |
| 1 | user | 11 | 44 | 2026-01-01 ERROR timeout connecting to cache |
| 2 | assistant | 26 | 103 | 1. Cache connection timed out. 2. Check network and credentials. 3. Retry after … |
Nearby workflows on Toolcore
- Chat turn token breakdown — Split User:/Assistant: exports and estimate rough tokens per turn—offline conversation planning, not tokenizer-exact. when you want a second pass with AI-assisted explanation on Toolcore.
- LLM token estimate — Rough character-based token planning for prompts and context—CJK-aware heuristic, browser-only—not tokenizer-exact. when you want a second pass with AI-assisted explanation on Toolcore.
- JSON formatter — JSON format online: pretty-print, minify, validate, escape, download . when you want a second pass with AI-assisted explanation on Toolcore.
- LLM API cost calculator — Estimate per-request and monthly chat spend from input/output token counts and your price per million—browser-only arithmetic, not live pricing. when you want a second pass with AI-assisted explanation on Toolcore.
Common use cases
- Inspect which turns dominate a chat/completions request body before trimming history.
- Validate exported conversation JSON from scripts or logs without sending it anywhere.
- Compare system vs user share when tuning prompt templates.
Common mistakes to avoid
Pasting production secrets in message content
Redact tokens and keys first—even though processing is local, exports may be saved.
Expecting vision or tool-call parts to be fully modeled
Text parts are summed; exotic content shapes may need manual review.
FAQ
Which JSON shape is supported?
An object with a messages array; each item should have role and content (string or text parts array).
Does this send data to an API?
No. Parsing and counts run entirely in your browser.
More tools
Related utilities you can open in another tab—mostly client-side.
Chat turn token breakdown
ClientSplit User:/Assistant: exports and estimate rough tokens per turn—offline conversation planning, not tokenizer-exact.
LLM token estimate
ClientRough character-based token planning for prompts and context—CJK-aware heuristic, browser-only—not tokenizer-exact.
JSON formatter
ClientJSON format online: pretty-print, minify, validate, escape, download .json.
LLM API cost calculator
ClientEstimate per-request and monthly chat spend from input/output token counts and your price per million—browser-only arithmetic, not live pricing.