JSON to TOON Converter — Cut Tokens in LLM Prompts
Paste JSON to get TOON, a compact format built for sending data to ChatGPT, Claude and other LLMs. The token counts show whether TOON actually saves anything for your data.
AI DevRuns in your browser — nothing uploaded
How it works
- 1
Lists become tables
An array of objects with the same keys is written once as a header — orders[5]{id,city,total}: — followed by one comma-separated row per item. Keys aren’t repeated, which is where most of the savings come from.
- 2
Objects use indentation
Nested objects are written like YAML: key: value, indented two spaces. No braces, and strings are only quoted when they have to be.
- 3
Honest comparison
Tokens are counted for pretty JSON, minified JSON and TOON. If TOON isn’t smaller than minified JSON for your data, the tool says so.
- 4
Converts back exactly
Switch to TOON → JSON to decode. Array lengths and row counts in the header are checked, so a truncated or edited TOON block shows an error instead of silently losing data.
Questions, answered
TOON (Token-Oriented Object Notation) is an open, MIT-licensed format that encodes the same data as JSON with fewer tokens. It mixes YAML-style indentation for objects with CSV-style rows for uniform arrays.
It depends on the shape of your data. Lists of records with the same keys — orders, users, log rows — often shrink 40–60% compared with pretty JSON. Deeply nested or irregular data saves little, and can be larger than minified JSON.
Yes. Modern LLMs read TOON without special instructions because it looks like YAML and CSV, which they’ve seen a lot of. For output, ask for JSON — models produce JSON more reliably.
Comma is the default and reads well. Tab often tokenizes slightly smaller and avoids quoting when values contain commas, such as addresses. Pipe is a readable middle ground.
No. Conversion uses the official TOON library and runs entirely in your browser.
Popular uses
Related tools
- Prompt CompressorCut tokens from prompts and code before you send them to an LLM.AI Dev
- Regex ExplainerPaste a regex, get plain English plus test cases.AI Dev
- AI SQL Query GeneratorEnglish to SQL for Postgres, MySQL and MSSQL.AI Dev
- JSON to Pydantic / TSInstant Pydantic models, TypeScript types or dataclasses.AI Dev