TOON Validator
Validate TOON syntax and check for errors
TOON Input
Validation Result
Paste your TOON on the left and the result shows up here.
Or drop a file on this box, , or .
What is TOON Validator?
Need to check if your TOON (Token-Oriented Object Notation) syntax is correct? This tool validates your TOON data, checking for syntax errors, structural issues, and formatting problems. TOON is a compact data serialization format designed for efficiency – perfect for catching errors before using TOON in production or sending it to LLMs and AI systems.
According to the official TOON documentation, proper validation ensures data integrity and prevents errors in downstream processing. Our validator applies the same rules as the official TOON library to check your syntax, validate array lengths, verify tabular row counts, and ensure proper structure. If there are errors, we'll show you exactly where they are. Similar to how JSON follows the RFC 8259 specification, TOON has its own structured format rules we validate against.
The check runs inside this page, so a prompt payload you are debugging is not stored. Press Invalid Sample to see a failure first: it loads a users[3] block with a fourth row for Diana, and the right panel answers Expected 3 tabular rows, but found more. Once the input passes, tidy the spacing with the TOON Formatter, or hand it to TOON to JSON to see exactly what a decoder will get.
What Makes This Tool Different
Real-Time Validation
Validation happens as you type. See results immediately – no need to click a button. Catch errors before they become problems.
Detailed Error Messages
Invalid TOON? You get the parser's error message and the line it points to, plus a short list of the usual causes to check.
Structure Analysis
Valid TOON? We'll show you the document type (object, array, primitive), item counts, keys, and structure information. Perfect for understanding your data.
File Upload Support
Got a TOON file? Just upload it. Works with .toon and .txt files. No need to copy-paste – just drag and drop or click upload.
Visual Feedback
Clear visual indicators show validation status. Green badge for valid TOON, red badge for invalid. See results at a glance.
Common Error Help
When errors occur, we provide helpful tips about common TOON mistakes – missing array lengths, mismatched row counts, invalid delimiters, and more.
How It Works
Paste or Upload TOON
Paste the TOON you want checked, or load a .toon or .txt file through Upload. Valid Sample loads a three-row users table that passes; Invalid Sample loads the same table with one row too many, so you can see what a failure report looks like before you try your own.
Automatic Validation
As soon as you paste, the validator checks your TOON syntax and displays results on the right. Valid TOON shows structure information, invalid TOON shows detailed error messages.
Review Results
Check the validation badge (green for valid, red for invalid) and review the detailed output. Fix any errors, then validate again. Copy results if needed.
When You'd Actually Use This
Before LLM Processing
Sending TOON data to LLMs? Validate it first to ensure it's correct. Invalid TOON can cause LLM errors or incorrect parsing, wasting tokens and API calls.
Debugging
Something not working with your TOON data? Validate it to find syntax errors, structural issues, or formatting problems. Clear error messages help you fix issues fast.
Code Review
Reviewing TOON files in pull requests? Validate them to ensure they're syntactically correct before merging. Catch errors early in the development process.
Learning TOON
Learning TOON syntax? Use the validator to check your examples, just as you'd use JSONLint when learning JSON. See what's valid, what's invalid, and understand the error messages to improve your TOON skills.
Common Questions
Is my TOON data stored?
No. The page runs your text through the @toon-format/toon decoder in strict mode, plus one extra indentation check of its own, and shows the verdict on the right. All of that happens in the tab; the TOON is never uploaded, so it is fine to paste the payload you were about to send to a model.
What does the validator check?
Syntax, array length markers like [3], tabular row counts, delimiters, indentation (two spaces per level is the norm; a file indented by four throughout is read with four) and quoting, using the @toon-format/toon parser in strict mode. On top of that, it catches lines indented under a key that already has a value, which would otherwise be dropped without an error.
Can I validate invalid TOON?
Yes, that's the point. Paste it and you get the error message, the line number, and a list of common causes (wrong row count, wrong indentation, delimiter mix-ups) to check against.
What information does valid TOON show?
For valid TOON, we show document type (object, array, primitive), item counts, keys (for objects), and structure information. Helps you understand your data better.
How accurate are error line numbers?
They come straight from the TOON parser, which reports the line it was on when it failed, so they're exact for most errors. A wrong row count is reported where the parser noticed it, which can be the header line rather than the row you forgot. The validator also flags a line that is indented under a key that already has a value, which the library itself would silently ignore.
Does validation affect my data?
No. Validation is read-only. We only check your TOON syntax – we don't modify, store, or change your data in any way.
Other TOON Tools You Might Need
A passing check is usually step one. These pages take valid TOON the rest of the way, or turn other data into TOON in the first place: