On this page
Overview
Moshi is a JSON library for Android, Java, and Kotlin. JsonAdapter connects JSON reading and writing to application types, with built-in adapters, custom adapters, and either reflection or code generation for Kotlin models.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Centralize JSON-to-type conversion in JsonAdapter
Moshi handles primitives, collections, strings, enums, and model types through JsonAdapter instances. The same adapter owns fromJson and toJson behavior for a model.
Sources: [2]
Best fit
Fits Android and JVM clients that map API JSON into explicit models
Applications can keep JSON response handling at typed boundaries and control nulls, unexpected values, and custom formats through adapters rather than spreading parsing logic through business code.
Sources: [2]
Before adoption
Choose the Kotlin adapter strategy deliberately and separate stable 1.x from the 2.x preview
Plain Java reflection is unsupported for Kotlin classes, so Kotlin models need code generation or KotlinJsonAdapterFactory. Stable 1.15.2 also coexists with a 2.0.0-alpha.1 preview whose Kotlin-facing changes can affect source compatibility; review the migration notes before adopting the preview.
Official sources
- [1]square/moshi — GitHub repository(2026-10-06)
- [2]Moshi 1.15.2 — README(2026-10-06)
- [3]Moshi 1.15.2 — CHANGELOG(2026-10-06)
- [4]Moshi current CHANGELOG(2026-10-06)
- [5]Moshi Apache-2.0 license(2026-10-06)
Supplemental curator note
Moshi works well for explicit JSON model boundaries on Android and the JVM. Choose between reflection and KSP code generation for Kotlin models, and evaluate the 2.x preview separately from the stable 1.x line.
Try it in 3 steps
- 1
Add the Moshi 1.15.2 Kotlin adapter
Pin stable 1.15.2 and use KotlinJsonAdapterFactory reflection for this minimal check.
implementation("com.squareup.moshi:moshi-kotlin:1.15.2") - 2
Create Moshi and a typed adapter
Register the Kotlin adapter factory and obtain a JsonAdapter for the User type.
import com.squareup.moshi.Moshi import com.squareup.moshi.adapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory data class User(val name: String) val moshi = Moshi.Builder().addLast(KotlinJsonAdapterFactory()).build() val adapter = moshi.adapter<User>() - 3
Decode JSON into the Kotlin object
Call fromJson with a minimal JSON document and confirm that it produces a User object.
println(adapter.fromJson("""{"name":"Moshi"}"""))
Growth
Growth trends · Last 30 days
10,165 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 0
- Open PRs
- 19
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
- Stars
- 10,165
- Forks
- 811
- Watchers
- 182
- Open issues
- 94
- Contributors
- 83
- 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
- AndroidX Test1,226 Stars
3 shared tag(s) · 1 shared category(s)
build Android instrumented and UI tests with AndroidJUnitRunner, Espresso, and AndroidX Test Core
Java - Kotlin53,479 Stars
3 shared tag(s) · Same language
keep Java interoperability while extending one language from JVM to Android, iOS, desktop, and web
Kotlin - OkHttp47,086 Stars
3 shared tag(s) · Same language
centralize HTTP, TLS, connection reuse, caching, and DNS for Android/JVM applications
Kotlin - REST Assured7,141 Stars
3 shared tag(s)
test REST APIs from Java with a DSL for requests, status, headers, and JSON/XML assertions
Java - ZEN Engine2,037 Stars
3 shared tag(s)
define a business decision once in JSON and deliver it across runtimes
Rust - LeakCanary30,005 Stars
2 shared tag(s) · 1 shared category(s) · Same language
trace retained Android objects to the references causing memory leaks
Kotlin
Report incorrect information
Tell us if any listing information is incorrect or outdated.