Playground¶
Try AGON encodings in real-time. Enter JSON data and see how each format encodes it, with live token comparison.
JSON Input
Token Comparison
How It Works¶
The playground encodes your JSON data using all four AGON formats simultaneously:
| Format | Best For | Typical Savings |
|---|---|---|
| JSON | Baseline / irregular data | 0% (baseline) |
| AGONRows | Uniform arrays with 2-10 fields | 30-60% |
| AGONColumns | Very large objects (100+ fields) | 20-50% |
| AGONStruct | Repeated nested patterns | 10-30% |
The Auto Selection indicator shows which format AGON would choose based on:
- Minimum 10% savings threshold vs compact JSON
- Data structure analysis (uniform arrays, wide tables, repeated patterns)
Format Selection Notes¶
Rows wins for most cases: - Uniform arrays with consistent fields (even with 10-20 fields per record) - Example: 788 employee records with 12 fields each in benchmarks
Columns wins for very large objects: - Single objects with 100+ fields (like quote.json with 170 fields in benchmarks) - Type clustering benefits outweigh format overhead at this scale
Struct wins for repeated patterns:
- Objects with the same structure appearing 3+ times
- Common pattern: {fmt, raw} for formatted/raw value pairs
Try It¶
- Token counts use
js-tiktokenwitho200k_baseencoding (GPT-4o default) - The JavaScript encoders match the Python/Rust AGON library behavior
- Token counting matches Python's tiktoken library exactly