Guide · 5 min read
Using TOON Format with ChatGPT and Claude
TOON works with any LLM that understands structured text. This guide shows you exactly how to pass TOON data in your prompts, what to add to your system prompt, and how to verify the model reads it correctly.
Last updated: June 2026 · Author: JSONtoTOON Team
Step 1 — Convert your JSON to TOON
Use the free converter. Paste your JSON, click Convert, copy the TOON output. The process takes under ten seconds for any file up to 50 MB.
Step 2 — Add a TOON description to your system prompt
LLMs have not seen TOON in their training data the way they have seen JSON. A short description of the format at the top of your system prompt is enough for the model to parse it correctly. Here is a template you can copy:
The data in this message is in TOON format (Token-Oriented Object Notation).
TOON is a compact, human-readable format:
- Objects: key: value pairs, one per line, indented for nesting
- Uniform arrays: arrayName[N]{col1,col2,...}: followed by N rows of comma-separated values
- Primitive arrays: arrayName[N]: val1,val2,...
TOON is lossless JSON — all types and structures are preserved.Step 3 — Include the TOON data in your prompt
Paste the TOON output where you would normally paste JSON. For example:
[System prompt with TOON description above]
Here is our user database in TOON format:
users[5]{id,name,email,role,active}:
1,Alice Chen,alice@example.com,admin,true
2,Bob Smith,bob@example.com,user,true
3,Carol White,carol@example.com,user,false
4,Dan Brown,dan@example.com,editor,true
5,Eve Davis,eve@example.com,user,true
Please list all active users by role.Step 4 — Verify with a sanity check
On first use, ask the model to confirm a specific value from the data before running your actual task. This confirms it parsed the TOON correctly:
Before answering, confirm: what is the email address of the user with id 3?
Expected answer: carol@example.com. If the model answers correctly, TOON is being parsed as expected. If not, check that the system prompt description is included and the TOON data is not truncated.
ChatGPT-specific notes
- Add the TOON description to your Custom Instructions or to a GPT's system prompt.
- ChatGPT supports TOON in the message body, code blocks, and file uploads.
- For GPT Actions, you can convert API response JSON to TOON server-side before returning it, cutting your context usage on every tool call.
Claude-specific notes
- Add the TOON description to Claude's system prompt in the API call or in a Project's system instructions.
- Claude 3.5 Sonnet and Haiku both parse TOON reliably in our testing.
- Claude's prompt caching pairs especially well with TOON: cache the system prompt + TOON description, keep only the user query variable. Combined savings can reach 70%+ per call.
Llama, Mistral, and other open-source LLMs
Open-source models work identically. Add the TOON description to the system prompt in whatever format your inference framework uses (Ollama, vLLM, llama.cpp, etc.). TOON is plain text — there is nothing model-specific about it.
Handling TOON output from an LLM
If you ask the model to produce TOON output (rather than read it), you can convert it back to JSON with the converter's Reverse button, or parse it programmatically using the TOON decoder. Be aware that models occasionally produce subtly malformed TOON (extra whitespace, incorrect header counts) — always validate the output before using it in production.
Ready to try?
Convert your prompt's data payload now and see exactly how many tokens you save on your specific data.
Open the Converter →