On this page
Overview
kotlinx.serialization is the official library for converting Kotlin types to data formats such as JSON and decoding them back. A compiler plugin generates handling code for classes annotated with @Serializable, while runtime libraries implement individual formats. The same model definitions can be used in multiplatform code spanning JVM, JS, and Native.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Use type definitions across JSON, Protocol Buffers, CBOR, and other formats
The plugin generates reflectionless conversion code for @Serializable Kotlin classes and standard collections. Official format libraries cover JSON, Protocol Buffers, CBOR, HOCON, and Properties, with typed round trips through APIs such as Json.encodeToString and Json.decodeFromString.
Sources: [1]
Best fit
Fits shared models used across runtimes and wire formats
It suits Kotlin Multiplatform applications sharing common models across JVM, JS, and Native, as well as projects that want typed API payloads, configuration, or stored data. It is especially useful when JSON is the starting point but the same model definitions may also need Protocol Buffers or CBOR.
Sources: [1]
Before adoption
Manage compiler-plugin and runtime-library versions separately
The serialization plugin follows the Kotlin compiler version, while runtime libraries have an independent version line. The stable 1.11.0 README pairs the runtime with Kotlin 2.3.20. Android shrinker rules are bundled for ordinary serializable classes, but classes with named companion objects need additional rules. Format compatibility and defaults should be reviewed in the changelog during upgrades. The project is Apache-2.0 licensed.
Official sources
- [1]Kotlin/kotlinx.serialization — README 1.11.0(2026-10-04)
- [2]Kotlin/kotlinx.serialization — CHANGELOG 1.11.0(2026-10-04)
- [3]kotlinx.serialization 1.11.0 release(2026-10-04)
- [4]Kotlin/kotlinx.serialization — LICENSE(2026-10-04)
Supplemental curator note
Its practical advantage is keeping Kotlin types at the center instead of maintaining hand-written conversion code for every format. Plan upgrades carefully because the compiler plugin and runtime libraries follow different version lines.
Try it in 3 steps
- 1
Enable the compiler plugin
In an existing Kotlin/JVM Gradle project, use Kotlin 2.3.20 for both Kotlin and the serialization compiler plugin.
plugins { kotlin("jvm") version "2.3.20" kotlin("plugin.serialization") version "2.3.20" } - 2
Add the JSON library
Add it to the Gradle dependencies block and use mavenCentral().
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.11.0") - 3
Encode and decode a typed value
Import kotlinx.serialization.* and kotlinx.serialization.json.*, declare Project at file scope, and run the conversion inside main.
@Serializable data class Project(val name: String, val language: String) fun main() { val text = Json.encodeToString(Project("demo", "Kotlin")) println(Json.decodeFromString<Project>(text)) }
Growth
Growth trends · Last 30 days
5,946 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 2
- Open PRs
- 38
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- kotlin
- serialization
- json
- cbor
- protobuf
- Stars
- 5,946
- Forks
- 685
- Watchers
- 100
- Open issues
- 268
- Contributors
- 198
- Owner type
- Organization
- Primary language
- Kotlin
- License
- Apache-2.0
- Repository last updated
- Oct 1, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- QGIS14,456 Stars
2 shared tag(s)
Manage spatial editing, analysis, cartography, and server delivery in one GIS platform
C++ - REST Assured7,140 Stars
2 shared tag(s)
test REST APIs from Java with a DSL for requests, status, headers, and JSON/XML assertions
Java - ZEN Engine2,034 Stars
2 shared tag(s)
define a business decision once in JSON and deliver it across runtimes
Rust - Node.js122,253 Stars
1 shared tag(s) · 2 shared category(s)
Run JavaScript for API servers, command-line tools, and development automation
JavaScript - Timber10,852 Stars
1 shared tag(s) · 1 shared category(s) · Same language
Organize Android logging through a small API and replaceable output trees
Kotlin - Koin10,022 Stars
1 shared tag(s) · 1 shared category(s) · Same language
configure lightweight dependency injection for Kotlin, Android, and Kotlin Multiplatform through concise module DSLs
Kotlin
Report incorrect information
Tell us if any listing information is incorrect or outdated.