JSON to TOON

Free Token-Oriented Object Notation · Up to 60% fewer tokens for LLM prompts
Delimiter
Indent
Error
JSON
TOON
// output here

その他の開発ツール

JSON フォーマッター
整形・検証・圧縮
JSON→YAML
YAML に変換
JSON→CSV
CSV に変換
JSON→XML
XML に変換
TOON フォーマッター
整形・検証
TOON→JSON
JSON に変換
Base64
エンコード
URL エンコード
パーセント変換

About TOON (Token-Oriented Object Notation)

What is TOON?

TOON is a compact, lossless encoding of the JSON data model designed for LLM prompts. It uses YAML-style indentation for nested objects and a CSV-style tabular layout for uniform arrays — up to 60% fewer tokens than JSON.

Tabular Arrays

TOON's biggest win: arrays of uniform objects collapse into a header row [N,]{fields}: followed by comma-separated data rows — just like CSV but with explicit structure.

Minimal Quoting

Strings are only quoted when necessary — when they look like a number, boolean, null, contain the delimiter, have leading/trailing whitespace, or are empty. Everything else is written bare.

LLM-Optimised

TOON achieves 76% LLM accuracy vs JSON's 75% on data-retrieval benchmarks, while using ~40% fewer tokens. Best used as a translation layer: keep JSON for APIs, send TOON to LLMs.

よくある質問

How does TOON encode nested objects?

Nested objects use indentation instead of curly braces. Each key-value pair is written as key: value, and nested objects add one level of indentation (2 spaces by default).

What is the tabular array format?

When all objects in an array share the same primitive-valued fields, TOON writes a header [N,]{f1,f2,f3}: followed by one comma-separated row per object. This is the biggest source of token savings.

Is TOON lossless?

Yes. TOON encodes the same objects, arrays, and primitives as JSON. You can round-trip JSON → TOON → JSON without any data loss. Types are preserved through TOON's quoting rules.

When should I use TOON vs JSON?

Use TOON when sending structured data to an LLM as context or input. The token savings directly reduce API cost and allow more data to fit in the context window. Keep JSON for programmatic APIs, databases, and anywhere that requires strict interoperability.

詳細ガイド
JSON 完全ガイド
フォーマット・検証・変換・ベストプラクティス
ガイドを読む