JSON to TONL Converter
Input JSON
or drop a file anywhere
Output TONL
Your TONL appears here as you type.
Paste data to see token savings
Convert JSON to TONL with our free online converter.
Example: JSON input and real TONL output
The output below was generated by the same conversion code the converter uses, run on this sample when the page was built.
{
"orders": [
{
"id": 1001,
"status": "shipped",
"total": 59.9,
"customer": {
"name": "Ana Ruiz",
"country": "ES"
},
"items": [
"SKU-104",
"SKU-221"
]
},
{
"id": 1002,
"status": "pending",
"total": 18.5,
"customer": {
"name": "Jonas Berg",
"country": "SE"
},
"items": [
"SKU-310"
]
},
{
"id": 1003,
"status": "shipped",
"total": 112,
"customer": {
"name": "Mei Tanaka",
"country": "JP"
},
"items": [
"SKU-104",
"SKU-415",
"SKU-502"
]
}
]
}#version 1.0
root:
orders[3]:
[0]{customer,id,items,status,total}:
customer{country,name}:
country: ES
name: Ana Ruiz
id: 1001
items[2]: SKU-104,SKU-221
status: shipped
total: 59.9
[1]{customer,id,items,status,total}:
customer{country,name}:
country: SE
name: Jonas Berg
id: 1002
items[1]: SKU-310
status: pending
total: 18.5
[2]{customer,id,items,status,total}:
customer{country,name}:
country: JP
name: Mei Tanaka
id: 1003
items[3]: SKU-104,SKU-415,SKU-502
status: shipped
total: 112TONL output is 8% smaller than the JSON input. The same data is 375 characters as minified JSON and 689 as pretty-printed JSON. Sizes are character counts, not tokens: token counts depend on the model's tokenizer (see the tokenizer comparison).
JSON to TONL: what changes
- TONL and TOON both compress JSON, but TONL adds a version header, a root wrapper, and field lists on each object. Pick TONL when you plan to use its query or schema features, and TOON when the goal is the smallest prompt.
- Reading JSON: Input must be strict JSON: no comments, trailing commas, or single quotes. If it came from an LLM or a log file, run it through the JSON repair tool first.
- Writing TONL: TONL output starts with #version 1.0 and a root key, lists field names in braces, and sorts keys alphabetically. On small payloads the header and per-object field lists make it larger than TOON; TONL earns its place through its query, schema, and streaming tooling.
About JSON
JavaScript Object Notation is the most widely used data interchange format. Lightweight, easy to parse, and supported by every programming language.
- ✓Universal compatibility
- ✓Easy to parse
- ✓Great for APIs
- ✓Native in JavaScript
About TONL
TONL (Token-Optimized Notation Language) is a compact text format that maps one-to-one to JSON and ships with a query API, schema validation, and streaming. Savings are roughly 32-45% versus JSON in the TONL project's own measurements.
- ✓Lossless round trip to JSON
- ✓Query and aggregation API
- ✓Schema validation (TSL)
- ✓Streaming for large files
Why Convert JSON to TONL?
Use TONL when you want a compact text format plus tooling around it: querying, schema validation, or streaming. For plain prompt compression, TOON is usually the simpler choice.
JSON to TONL: Frequently Asked Questions
How do I convert JSON to TONL?
Paste your JSON into the editor on json2toon.co. The tool detects the input and produces TONL instantly, then you copy the result. Conversion runs entirely in your browser, so nothing is uploaded to a server.
Is the JSON to TONL converter free?
Yes. Converting JSON to TONL on json2toon.co is free with no account, signup, or usage limit. A free public API is also available for automated, programmatic conversion.
Why convert JSON to TONL?
Convert JSON to TONL with our free online converter.
What should I watch out for when converting JSON to TONL?
TONL and TOON both compress JSON, but TONL adds a version header, a root wrapper, and field lists on each object. Pick TONL when you plan to use its query or schema features, and TOON when the goal is the smallest prompt.
Is my data safe when I convert JSON to TONL?
Yes. The JSON to TONL conversion happens client-side in your browser. Your source data stays on your device and is never sent to or stored on a server, which makes it safe for private or sensitive payloads.