Keys once, values by position
A header names the fields. Each row lists only values, in header order. Words without spaces need no quotes.
id name [tags]
[
[1 Ada [math code]]
[2 Linus []]
] LWON writes the shape of your data once and the values by position. It converts any JSON value and back without loss, and uses 21–42% fewer Claude tokens than minified JSON on typical API and tool data.
[
{"id":1,"name":"Ada","role":"admin"},
{"id":2,"name":"Linus","role":"dev"},
{"id":3,"name":"Grace","role":"dev"}
]id name role
[
[1 Ada admin]
[2 Linus dev]
[3 Grace dev]
] The examples below are real encoder output.
A header names the fields. Each row lists only values, in header order. Words without spaces need no quotes.
id name [tags]
[
[1 Ada [math code]]
[2 Linus []]
] Objects and lists of objects get their own field lists inside the header, so deep data is still written once.
{[orders[id customer[name city] [items[sku qty]]]]}
[[[A-1 [Ann Izmir] [[K1 2]]]]] @ reuses an enclosing field list. Menus, file trees and comment threads need one short header at any depth.
title [children[@]]
[
[Docs [[Spec []] [API []]]]
] Keys most rows lack move to a * slot at the end of the header, and each row names them. Models read sparse data without counting positions.
id level userId *
[
[1 info 7]
[2 warn 9]
[3 error ~ {"retry":2}]
] A value that does not fit the header is written as plain JSON in its slot. Nothing is ever dropped.
id [data[deep]]
[
[1 text]
[2 [1 [true]]]
] Six realistic datasets, counted with Claude's own tokenizer and measured against minified JSON, the fair baseline, and against TOON, another format built for LLMs. LWON's lead grows with nesting.
users Flat table, 100 rows
orders Nested objects and arrays, 50 orders
issues GitHub-style issues with nullable objects, 30 rows
menu Recursive tree, 3 levels
logs Log events with optional fields, 80 rows
search Search tool result: object with a result list
Counted with the Claude count_tokens API (Haiku, Sonnet and Opus 5.5 share a tokenizer). Data only. TOON: @toon-format/toon 4.4.0. Lower is better.
Nulls, empty arrays, missing keys, odd key names and fields that change type from row to row all survive the trip. The reference library is tested against a shared conformance suite and a fuzzer that generates hostile JSON.
| JSON | LWON | Meaning |
|---|---|---|
null | null | The key is there; its value is null. |
[] / {} | [] / {} | Empty array, empty object. |
| key missing | ~ | The key is absent. At the end of a row it can be left out. |
Tool results, API responses and retrieved records are mostly repeated keys and punctuation. Encode them as LWON in your tool layer and send a primer of about 328 tokens once, so the model reads the same data for fewer tokens.
132 of 132 answers were correct when Claude Haiku, Sonnet and Opus 5.5 answered 44 questions about LWON data, the same score as with JSON.
Read the AI guideJSONlwon.encode(data)PRIMER + LWONPaste any JSON. The playground converts both ways and counts the tokens in your browser.
Open the playground