Stage 01 · Write · Researched comparison
Best Kotlin JSON Libraries in 2026
kotlinx.serialization is the first pick for most Kotlin projects. It is built for Kotlin, works on multiplatform targets, and the JSON format ships with the library. Choose Moshi if you want a mature reflection and codegen option with strong Android support. Choose Jackson with jackson-module-kotlin if you already run Jackson on the JVM and need its full data-binding feature set.
By Shihab Mia
Published 27 Nov 2026 · 5 tools compared
We run no ads and no affiliate links at launch. The order of a list follows our published method. See how we score.
Prices are the starting prices vendors list publicly. Plans change, so confirm the current price on the vendor page before you buy.
Key takeaways
- kotlinx.serialization is free and open source under Apache 2.0, and its JSON support works on JVM, Android, Native and JS targets.
- Moshi, Jackson, Gson and Klaxon are all free and open source, so the choice comes down to Kotlin fit, platform support and null-safety behavior.
- Gson ignores Kotlin null-safety by default, so non-null Kotlin fields can still end up null after parsing unless you add checks.
Who each pick is for
- Kotlin-first projects, including multiplatform targetskotlinx.serialization
- Android and JVM apps that want reflection or codegenMoshi
- JVM services already built on JacksonJackson with jackson-module-kotlin
- Legacy Java codebases that already use GsonGson
- Small Kotlin projects that want a lightweight parserKlaxon
Comparison
| Tool | Best for | Standout feature | Listed starting price | Free plan or trial |
|---|---|---|---|---|
| 1kotlinx.serialization | Kotlin-first projects, including multiplatform targets | Compiler plugin generates serializers at build time | Free (open source) | Free plan |
| 2Moshi | Android and JVM apps that want reflection or codegen | Kotlin codegen module avoids reflection | Free (open source) | Free plan |
| 3Jackson with jackson-module-kotlin | JVM services already built on Jackson | Full Jackson feature set, including streaming and data binding | Free (open source) | Free plan |
| 4Gson | Legacy Java codebases that already use Gson | Simple API and wide adoption in Java projects | Free (open source) | Free plan |
| 5Klaxon | Small Kotlin projects that want a lightweight parser | Kotlin-oriented API with a simple object mapper | Free (open source) | Free plan |
How we picked
We compared libraries on fit for Kotlin work, supported platforms, licence and price, how each handles Kotlin nullability and default values, and the main limits such as compiler plugin requirements or JVM-only support. Sources are vendor documentation, project repositories and public licence files. Prices and release activity change, so confirm details on each project's repository before you commit.
The tools, one by one
kotlinx.serialization
Best for kotlin-first projects, including multiplatform targets

What it is and where it fits
kotlinx.serialization is JetBrains' official serialization library. You mark classes with @Serializable, and the compiler plugin generates the serializer code. The kotlinx-serialization-json module provides the JSON format with configuration for pretty printing, unknown keys, and coercion of primitive values.
It targets JVM, Android, Kotlin/Native and Kotlin/JS, which makes it the usual choice for Kotlin Multiplatform projects that share models and network code. The library is Apache 2.0 licensed and published on Maven Central. The main cost is build setup: you add the serialization plugin to your Gradle build, and some reflection-based patterns do not carry over directly.
Skip it if your project cannot use compiler plugins or if you depend on a Java serialization framework that other code already uses.
Standout: Compiler plugin generates serializers at build time
Free (open source), as listed by the vendor (kotlinx.serialization website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Compiler plugin generates serializers at build time
- JSON format supports Kotlin Multiplatform targets
Drawbacks
- Requires the compiler plugin
- reflection-based setup is not the default path
Skip it if this limit matters to you: requires the compiler plugin.
Verdict. A sensible pick for kotlin-first projects, including multiplatform targets.
Alternatives in this guide: Moshi, Jackson with jackson-module-kotlin, Gson
Moshi
Best for android and JVM apps that want reflection or codegen

What it is and where it fits
Moshi is a JSON library from Square with first-class Kotlin support. It offers a reflection-based path and a moshi-kotlin-codegen module that generates adapters at compile time. The codegen path is the recommended one for Android because it avoids reflection at runtime.
Moshi handles Kotlin nullability and default values through its Kotlin adapter support. It runs on JVM and Android. It is Apache 2.0 licensed. Custom types are handled with JsonAdapter classes, which is straightforward once you learn the adapter model.
The tradeoff is platform reach. Moshi is not a Kotlin Multiplatform library in the way kotlinx.serialization is, so shared modules that target Native or JS need a different approach. Skip it if multiplatform sharing is a core requirement.
Standout: Kotlin codegen module avoids reflection
Free (open source), as listed by the vendor (Moshi website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Kotlin codegen module avoids reflection
- clear adapter model for custom types
Drawbacks
- Multiplatform support is limited compared with kotlinx.serialization
- codegen adds a build step
Skip it if this limit matters to you: multiplatform support is limited compared with kotlinx.serialization.
Verdict. A sensible pick for android and JVM apps that want reflection or codegen.
Alternatives in this guide: kotlinx.serialization, Jackson with jackson-module-kotlin, Gson
Jackson with jackson-module-kotlin
Best for jVM services already built on Jackson

What it is and where it fits
Jackson is a long-established Java JSON library, and jackson-module-kotlin adds support for Kotlin classes. The module lets Jackson call Kotlin constructors, handle default parameter values, and respect nullability in many cases. It works with Jackson's databind and streaming APIs.
This is the practical pick when a JVM service, such as a Spring Boot application, already uses Jackson. You keep one object mapper and one set of annotations across Java and Kotlin code. The library is Apache 2.0 licensed and runs on the JVM.
The cost is complexity. Jackson has many modules and configuration options, and Kotlin support depends on the Kotlin module being registered correctly. Skip it for small Kotlin-only projects where a lighter library covers the need.
Standout: Full Jackson feature set, including streaming and data binding
Free (open source), as listed by the vendor (Jackson with jackson-module-kotlin website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Full Jackson feature set, including streaming and data binding
- Kotlin module handles constructors and nullability
Drawbacks
- More configuration surface than smaller libraries
- JVM-focused
Skip it if this limit matters to you: more configuration surface than smaller libraries.
Verdict. A sensible pick for JVM services already built on Jackson.
Alternatives in this guide: kotlinx.serialization, Moshi, Gson
Gson
Best for legacy Java codebases that already use Gson

What it is and where it fits
Gson is Google's JSON library for Java. It maps objects with reflection and needs little setup. For Kotlin, that simplicity comes with a caveat: Gson can set non-null Kotlin properties to null when a JSON field is missing or explicitly null, because it does not read Kotlin nullability metadata.
You can work around this with custom adapters, default values plus validation, or by using a Kotlin-aware library instead. Gson is Apache 2.0 licensed and runs on the JVM and Android.
Choose it when you maintain a Java codebase that already depends on Gson and you want one library across both languages. For new Kotlin code, the null-safety gap is a real reason to look at kotlinx.serialization or Moshi first.
Standout: Simple API and wide adoption in Java projects
Free (open source), as listed by the vendor (Gson website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Simple API and wide adoption in Java projects
- no compiler plugin needed
Drawbacks
- Does not enforce Kotlin null-safety by default
- limited Kotlin-specific features
Skip it if this limit matters to you: does not enforce Kotlin null-safety by default.
Verdict. A sensible pick for legacy Java codebases that already use Gson.
Alternatives in this guide: kotlinx.serialization, Moshi, Jackson with jackson-module-kotlin
Klaxon
Best for small Kotlin projects that want a lightweight parser

What it is and where it fits
Klaxon is a JSON parser for Kotlin by Cédric Beust. It offers a lightweight API for reading JSON into Kotlin objects and for working with a JSON tree model. It does not need a compiler plugin, which keeps build setup simple.
The project is Apache 2.0 licensed and runs on the JVM. Its release cadence is slower than the larger libraries, and its ecosystem of integrations is smaller. Check the repository for recent commits and open issues before adopting it for a long-lived project.
It can suit small tools, scripts and projects where a minimal dependency is enough. For Android apps or multiplatform code, the larger libraries are usually the safer bet.
Standout: Kotlin-oriented API with a simple object mapper
Free (open source), as listed by the vendor (Klaxon website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Kotlin-oriented API with a simple object mapper
- supports parsing to JsonObject trees
Drawbacks
- Smaller community and slower release cadence than the main options
- fewer integrations
Skip it if this limit matters to you: smaller community and slower release cadence than the main options.
Verdict. A sensible pick for small Kotlin projects that want a lightweight parser.
Alternatives in this guide: kotlinx.serialization, Moshi, Jackson with jackson-module-kotlin
Who should use what
For a new Kotlin Multiplatform project, start with kotlinx.serialization so shared models work across targets. For an Android app that wants compile-time adapters without a compiler plugin, Moshi with codegen is a good fit. For a JVM service already running Spring or another Jackson-based stack, use Jackson with jackson-module-kotlin to keep one mapper. If you maintain a Java codebase on Gson, keep Gson but add null checks around Kotlin models. For a small script, Klaxon may be enough.
Questions to settle before you buy
What to check before you buy
- Confirm the library supports every target you build for, including Native or JS if you share code.
- Check how the library handles missing fields and Kotlin non-null properties, and test that behavior.
- Verify the build setup cost, such as a compiler plugin or codegen step, against your CI pipeline.
- Review the licence and the repository's recent commit activity before adopting a smaller project.
- Test round-trip parsing of your real payloads, including unknown fields and default values.
FAQ
Is kotlinx.serialization the best default for Kotlin?
For most new Kotlin projects, yes. It is built for Kotlin, supports multiplatform targets, and the JSON format is part of the same project. The main requirement is adding the compiler plugin to your build. Projects that cannot use compiler plugins should look at Moshi or Jackson instead.
Does Gson respect Kotlin null-safety?
No, not by default. Gson uses reflection and does not read Kotlin nullability metadata, so a missing or null JSON field can set a non-null Kotlin property to null. You need custom adapters or validation to prevent that. Kotlin-aware libraries such as kotlinx.serialization and Moshi handle this better.
Can I use Moshi in Kotlin Multiplatform projects?
Moshi is aimed at JVM and Android. It is not a Kotlin Multiplatform library in the way kotlinx.serialization is, so shared modules that target Native or JS need another option. For multiplatform code, kotlinx.serialization is the usual choice.
How does Jackson handle Kotlin default parameter values?
jackson-module-kotlin lets Jackson call Kotlin constructors and apply default parameter values when a JSON field is absent. Register the Kotlin module on your object mapper so constructors and nullability are handled correctly. Without it, Jackson falls back to Java-style behavior and Kotlin defaults may not apply.
Are these Kotlin JSON libraries free?
Yes. All the libraries listed here are open source and free to use. kotlinx.serialization, Moshi, Jackson, Gson and Klaxon are published under open-source licences, so there is no paid tier to compare.
Sources we checked
Method: how we score · editorial policy.
Change log. First published 27 Nov 2026.