How to convert JSON to TOON
Paste JSON into the left pane and the TOON output appears on the right, with a live panel showing the token count of each format and the percentage saved. Switch the direction dropdown to go from TOON back to JSON, pick the delimiter that suits your data, and copy the result or feed the output back in as input to verify a round-trip. Because both the encoder and the tokenizer run in your browser, you get the real token figures for proprietary data without sending anything to a server.
What TOON is
TOON, short for Token-Oriented Object Notation, is a compact serialization of JSON aimed at large-language-model prompts. JSON spends a lot of tokens on repeated keys, braces and quotes; for an array of objects that all share the same shape, TOON writes the field names once as a header and then lists each record as a delimited row — much like CSV — while still handling nesting and scalar types. The result reads naturally to a human and parses unambiguously, but costs noticeably fewer tokens. Converting JSON to TOON and back returns equivalent data, so it is a representation change, not a lossy summary.
Where the savings come from
The biggest wins come from uniform arrays of objects — exactly the shape of database rows, API list responses and CSV-like records — because the keys are stated once instead of on every element. Deeply nested or highly irregular data saves less, and a single small object may barely differ. The savings meter tokenizes both representations with the o200k_base encoding used by GPT-4o, so the percentage you see is the real reduction for that model, not a generic estimate. Use it to decide whether reformatting a payload is worth it before you wire it into a prompt.
When to use it
Reach for TOON when you are pasting structured data into a prompt and the token count matters: feeding a table of records to a model, stuffing context into a retrieval-augmented prompt, or trimming a payload to fit a context window. It pairs naturally with a token counter to confirm the budget and with a chunk splitter when the data is large. For data interchange between systems, stick with JSON — TOON's advantage is specifically in the token economy of LLM prompts.
Why convert locally
The data you most want to compress for a prompt is often the data you least want to upload — customer records, internal metrics, unreleased content. Running the TOON encoder and the tokenizer entirely in your browser means the payload and its token counts are computed on your device and nothing is logged, matching the gitime.dev default that your data stays local.
- Two-way — JSON to TOON and TOON to JSON.
- Measured — live tiktoken token-savings meter.
- Configurable — comma, tab or pipe delimiter.
- Lossless round-trip — values preserved.
- Local — payloads never uploaded.
Frequently asked questions
- What is TOON?
- Token-Oriented Object Notation — a compact, CSV-like encoding of JSON that uses fewer tokens in LLM prompts.
- Is the conversion lossless?
- For standard JSON, the round-trip preserves your values; TOON is a token-efficient representation, not a summary.
- How is the token saving measured?
- Both formats are tokenized with the o200k_base encoding in your browser and the difference is shown.
- Is my data uploaded?
- No. The encoder and tokenizer run locally, so your JSON is never sent to a server.