TOON Fixer
Automatically fix broken TOON (Token-Oriented Object Notation) syntax
What is the TOON Fixer?
TOON is unforgiving about whitespace. One stray space and the parser drops half your customer object. The fixer handles the usual breakage – indentation off by a space, header delimiters mixed (; vs ,), an unclosed quote inside a string, an array header like orders[2] that doesn't line up with the rows underneath. Paste the broken blob, hit the button, get back something a TOON parser will actually accept.
TOON (Token-Oriented Object Notation) is a compact alternative to JSON aimed at LLM prompts – the spec lives at toon-format/toon on GitHub. Conceptually it sits next to JSON and RFC 8259, but trades JSON's syntactic redundancy for fewer tokens. Like any other data-serialization format, it falls over on small whitespace mistakes – which is exactly what bites you when an LLM running on Cloudflare Workers AI emits TOON that is 95% right and 5% wrong.
Processing happens server-side and we don't persist the input. Fix the structure, paste the result back into your prompt or tool call, move on.
How to Use the TOON Fixer
Three steps. Each one uses the actual buttons on this page.
Paste Broken TOON or Load Sample
Drop your broken TOON into the left editor. Hit Sample TOON to load a deliberately-broken example with the most common mistakes. Example of what the fixer handles:
customer:
id, 4421
name "Ava Chen"
orders[1]{sku;qty}:
SKU-101,2It repairs bad indentation, mixed header delimiters (; vs ,), unclosed quotes, and misaligned array headers per the TOON spec.
Click Fix TOON!!
Hit the green Fix TOON!! button. The fixer parses your input, identifies the syntax issues, and writes the repaired version to the right pane. A loading indicator shows while it's working.
Review Fixed Output
The right pane shows the repaired TOON. Values stay untouched – only structure is corrected. Copy the output back into your prompt, tool call, or pipeline.
When You'd Actually Use This
Recovering Bad LLM Output
Your prompt asks for TOON, the model returns TOON-ish – right schema, wrong delimiter on the header row. Pipe the response through this instead of rewriting the prompt for the fifth time.
After Hand-Editing
You opened a TOON file in a text editor, tweaked one row, and now the children of <code>customer</code> won't parse because the indent is off by one space. The fixer catches that.
Debugging JSON↔TOON Pipelines
A converter script lost track of the column order on row 4 of <code>orders[3]</code>. Run the broken output through the fixer first, then diff against your expected TOON to see what your script actually produced.
Validating Prompt-Embedded Data
Before sending data to an LLM as TOON, run it through the fixer to make sure the model gets a clean payload – model behavior is much more predictable when the input parses on the first try.
Common Questions
Is my TOON data stored?
No. Repair runs on the server but we don't persist the input. Once the response goes back to your browser, it's gone from our side.
What kinds of errors does it fix?
Bad indentation, mismatched header delimiters (; vs ,), unclosed quotes, misaligned array headers like orders[2] that don't match their rows, stray colons – the day-to-day TOON breakage. It won't restructure your data, only fix the syntax around it.
Does it preserve my data?
Yes. Values are untouched. Only the syntax around them gets corrected.
How does TOON differ from JSON?
TOON encodes the same data as JSON in fewer tokens – useful when you're paying per token to an LLM. The format is documented at toon-format/toon; json.org and RFC 8259 are the JSON references for comparison.
Are there inputs it can't fix?
If the structure is so broken that the intent is ambiguous – e.g., the array header says 5 rows but only 2 rows exist and the columns don't match either – it'll fix what it can and leave the rest for you to review. Use the TOON Validator to confirm the fixed output is clean.
Can I convert the fixed TOON to JSON?
Yes – pipe the result through TOON to JSON and you've got a regular JSON object you can drop into any tool that speaks JSON.
Other TOON Tools You Might Need
Fixing is just one step. Here are the other TOON tools that work well alongside it: