Convert JSON to Token-Oriented Object Notation (TOON), a text format that writes repeated field names once in arrays of similar records. Paste JSON or open a file, then copy or download the TOON. The converter keeps every JSON value and checks the result by decoding it back. To choose fields or rows first, use the JSON Token Counter.
How to use it
- Paste valid JSON, open a file up to 2 MiB, or load the example.
- TOON appears automatically. Compare its token count with your original JSON.
- Review the output, then copy it or download converted.toon.
Read more: What is the TOON format? Syntax and examples · JSON vs TOON: token counts measured on six kinds of data · How to reduce JSON tokens for AI prompts
Private, local processing
This tool runs in your browser, in a background worker: nothing you paste or open is uploaded, and nothing is kept after you leave. This tool accepts up to 2 MiB of JSON and 64 levels of nesting. Filter larger files in the workspace first. Already loaded features keep working if your connection drops. Loading another tool or jq for the first time needs a connection. When one tool isn't enough, GigaJSON opens your data with a tree, a table, JSONPath/JMESPath/jq queries, transforms, diff and history.
When TOON saves tokens
We counted 100 records of six kinds of sample data with o200k_base. TOON was much smaller when every record fits one row, and larger than compact JSON when each record has a list field such as tags. The full measurement shows why.
| 100 records of | Compact JSON | TOON | TOON vs compact |
|---|---|---|---|
| Users (nested objects, no lists) | 10,364 | 6,499 | 37% fewer |
| Log events (nested objects, no lists) | 7,873 | 5,375 | 32% fewer |
| Products without tags | 8,875 | 5,121 | 42% fewer |
| Products with a tags list | 9,522 | 11,895 | 25% more |
| Orders (items and tags lists) | 18,578 | 19,354 | 4% more |
Questions
What is TOON?
Token-Oriented Object Notation, a readable text form of JSON data. For an array of objects with the same fields, it writes the field names once and then one row of values per object. It handles nested objects and the other JSON structures too.
What does the TOON format look like?
For a list of records, a header line gives the list's name, its length and the field names once, then each record is one indented row of values. {"users": [{"id": 1, "name": "Ada"}, {"id": 2, "name": "Linus"}]} becomes users[2]{id,name}: followed by the rows 1,Ada and 2,Linus. Single objects are written as key: value lines with indentation, much like YAML.
Does this converter remove or change values?
It keeps every field and row. The converter decodes its own output and checks that you'd get the same JSON values back. It refuses duplicate object keys, numbers it can't represent exactly, and any conversion that fails that check. Whitespace and the way numbers are written can change.
Does TOON always use fewer tokens?
No. Repeated records usually shrink, but other structures can come out smaller as compact JSON. The counts come from o200k_base on the actual text; other tokenizers and full API requests will differ. And fewer tokens won't guarantee better AI answers.
Can I use TOON anywhere I use JSON?
No, its syntax differs. Use it as readable data in a prompt where your workflow accepts it; an API or parser that expects JSON still needs JSON. This tool doesn't call an AI model.
How large can the input be?
Up to 2 MiB of JSON and 64 levels of nesting. For larger documents, use the GigaJSON workspace to select a smaller result first.
Is my data uploaded?
No. The tool runs in your browser, in a background worker. Nothing you paste or open goes to a server, and nothing is kept after you leave the page.
All tools
- JSON FormatterIndent with 2 or 4 spaces, sort keys
- JSON ValidatorLine and column of the first error
- JSON MinifierRemove whitespace, see the bytes saved
- JSON RepairFixes quotes, commas, comments, AI output
- JSON Schema GeneratorA JSON Schema from examples
- JSON Schema ValidatorCheck JSON against a schema
- JSON Token CounterCount tokens, select data, compare JSON and TOON
- JSON EditorTree and code editing, undo and history
- Large JSON ViewerTree, table and search for huge files
- JSON Lines ViewerJSONL and NDJSON logs as a table
- JSON Log ViewerCount and filter JSON Lines logs
- Large CSV ViewerCSV files too big for Excel, up to 1 GB
- JSON VisualizerThe data as a graph, PNG and SVG export
- JSON DiffChanges between two documents
- JSON Path FinderClick a value, copy its path
- JSONPath TesterJSONPath, JMESPath and jq, live
- JMESPath PlaygroundJMESPath, for AWS CLI queries too
- jq PlaygroundReal jq in your browser
- JSON to CSVNested objects become dotted columns
- JSON to ExcelAn .xlsx sheet, numbers kept as numbers
- CSV to JSONDelimiters detected, 007 stays 007
- JSON to XML@keys become attributes
- XML to JSONRSS feeds, sitemaps, SOAP responses
- JSON to YAMLReadable YAML, ambiguous strings quoted
- YAML to JSONAnchors and multiple documents
- JSON Lines to JSONNDJSON or JSONL into one array
- JSON to JSON LinesA JSON array as one record per line
- JSON to TOONConvert JSON to TOON, with token counts
- JSON to MermaidA flowchart or class diagram, drawn
- JSON SplitterCut a big file into parts, or sample it
- JSON to TypeScriptInterfaces inferred from your data
- JSON to GoGo structs with json tags
- JSON to RustRust structs that derive serde's Serialize and Deserialize
- JSON to PythonPython dataclasses with type hints
- JSON to JavaJava classes with getters and setters
- JSON to C#C# classes with System.Text.Json attributes
- JSON to KotlinKotlin data classes
- JSON to SwiftSwift structs that conform to Codable, with CodingKeys
- JSON to DartDart classes with fromJson and toJson
- JSON to ZodZod schemas with TypeScript types inferred from them
- JWT DecoderHeader, payload and expiry, locally
- JSON EscapeText to a JSON string and back
- Sample JSON FilesDownload test JSON, 100 KB to 1 GB
- Sample JSON Lines FilesDownload test NDJSON, one record per line
- Sample CSV FilesDownload test CSV, 100 KB to 1 GB
- Sample XML FilesDownload test XML, 100 KB to 1 GB
- Sample GeoJSON FilesPoints, lines and polygons, up to 1 GB
- Sample Nested JSONRecords 8 levels deep, up to 1 GB
- Sample Unicode JSON13 scripts, emoji and escapes
- Sample API ResponsesJSON:API, HAL, GraphQL, pages, errors
- Large JSON File GeneratorTest data from 100 KB to 1 GB