KToon: Tiny Tables, Big Savings Plug TOON into Your @Serializable Kotlin Classes
KToon is a new serialization format for Kotlin that reduces payload sizes by up to 67% compared to JSON by treating data collections as tables rather than repeated key-value objects. Built as a kotlinx.serialization plugin, it works seamlessly with existing @Serializable classes and integrates into Ktor with a single line of code. The format borrows token-efficient techniques from LLM systems, writing field names once as headers and streaming values below, achieving O(N) performance with minimal memory overhead. The implementation includes custom encoder, decoder, and lexer components totaling around 1000 lines of pure Kotlin.