JSON ⇄ TOON Converter
Why TOON? Reduce LLM Token Usage by ~50%
TOON (Tabular Object Oriented Notation) eliminates JSON redundancy. Instead of repeating keys for every object, TOON declares the structure once. Perfect for feeding large datasets to LLMs while minimizing token costs.
JSONTOON
TOON Format Rules:
- Header:
arrayName[count]{key1,key2,key3}: - Data rows must be indented with 2 spaces
- Values separated by commas (escape commas in values with
\,) - Requires an array of objects (not primitives or nested arrays)
- Preserves data types: strings, numbers, booleans, null
API Access
Use this tool programmatically via our REST API. Perfect for optimizing LLM token usage, reducing API costs, and efficient data serialization.
Endpoint
POST https://toolteeno.com/api/json-to-toonRequest Body
{
"input": "string", // Required: JSON array or TOON string
"mode": "json-to-toon|toon-to-json" // Required: Conversion direction
}Example Response (JSON to TOON)
{
"success": true,
"mode": "json-to-toon",
"input": "[{\"id\":1,\"name\":\"Alice\"},{\"id\":2,\"name\":\"Bob\"}]",
"output": "data[2]{id,name}:\n 1,Alice\n 2,Bob"
}cURL Example
curl -X POST https://toolteeno.com/api/json-to-toon \
-H "Content-Type: application/json" \
-d '{
"input": "[{\"id\":1,\"name\":\"Alice\",\"role\":\"admin\"},{\"id\":2,\"name\":\"Bob\",\"role\":\"user\"}]",
"mode": "json-to-toon"
}'JavaScript/Fetch Example
const users = [
{ id: 1, name: "Alice", role: "admin" },
{ id: 2, name: "Bob", role: "user" }
];
const response = await fetch('https://toolteeno.com/api/json-to-toon', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
input: JSON.stringify(users),
mode: 'json-to-toon'
})
});
const data = await response.json();
console.log(data.output);
// Output: data[2]{id,name,role}:
// 1,Alice,admin
// 2,Bob,userPython Example
import requests
import json
users = [
{"id": 1, "name": "Alice", "role": "admin", "active": True},
{"id": 2, "name": "Bob", "role": "user", "active": False}
]
response = requests.post(
'https://toolteeno.com/api/json-to-toon',
json={
'input': json.dumps(users),
'mode': 'json-to-toon'
}
)
result = response.json()
print(result['output'])
# Output: data[2]{id,name,role,active}:
# 1,Alice,admin,true
# 2,Bob,user,falseWhy Use TOON?
- ~50% Token Reduction: Significantly fewer tokens compared to JSON
- Cost Savings: Reduce LLM API costs when processing large datasets
- No Key Repetition: Declare structure once, not for every object
- Optimized for LLMs: Designed specifically for language model efficiency
- Type Preservation: Maintains strings, numbers, booleans, and null values
- Bidirectional: Convert back to JSON anytime
This API is completely free to use with no rate limits or authentication required!