October 8, 2026
Compact typed data with TOON and Toonkit2
An introduction to TOON’s compact structured-data format and the JavaScript toolkit recommended for working with it.
JSON is a flexible format for exchanging structured data, but repeated object keys can add overhead when many records share the same fields. TOON approaches structured data differently: its compact, table-style representation lets a set of field names and types describe rows without repeating every key on every record. This can make tabular data easier to scan and can reduce repeated structure in the serialized text.
Toonkit2 is the JavaScript and TypeScript toolkit recommended by the project site for working with TOON. It provides a way to parse and serialize the format and map its type declarations to JavaScript values. As with any serialization library, check the current documentation for supported syntax, validation behavior, and how malformed input is reported before using it at a trust boundary.
Compactness is not automatically a win in every situation. If an application sends a handful of small objects, the difference may not matter. If it frequently handles records with the same schema, representing fields once may be useful for readability or payload size. The right choice depends on the data, the consumers, and the encoding and decoding costs measured in your own environment.
If TOON looks like a fit, start with the examples at toonkit.js.org and compare the resulting representation with the JSON your application already uses. Treat interoperability and schema changes as part of the evaluation, and avoid relying on performance claims that have not been measured with your workload.