Mobile apps · Library

kotlinx.serialization

JetBrains' library for turning Kotlin objects into JSON (and other formats) and back, with the conversion code generated at compile time.

Android building blocks · Open source · updated

How it works

Mark a data class @Serializable and a Kotlin compiler plugin generates its serializer, so encoding and decoding need no reflection. That makes it fast, friendly to R8 shrinking, and usable on every Kotlin Multiplatform target, unlike reflection-based libraries such as Gson. JSON is the main format; Protobuf, CBOR and others are available.

Options cover real-world APIs: ignoreUnknownKeys for servers that add fields, default values for missing ones, @SerialName for fields named differently on the wire, and polymorphic types. Ktor and supabase-kt use it, and Retrofit has a converter for it.

kotlinx.serialization pricing

Open source

Free (Apache 2.0).

Approximate, checked September 2026.What the other tools cost

More in Mobile apps

Android building blocks

All 34 Mobile apps terms

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.