A modern JSON library for Kotlin and Java.
AI Analysis
Moshi is a modern JSON serialization/deserialization library for Kotlin and Java that converts between JSON strings and strongly-typed objects. It is designed for Android, Java, and Kotlin applications and serves developers who need efficient, type-safe JSON parsing with support for custom adapters and code generation. Not a general-purpose tool—specialized for the JVM ecosystem.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
Square's Moshi: A mature, Kotlin-first JSON library with a decade of Android production use
Moshi is a JSON serialization/deserialization library for Android, Java, and Kotlin, created by Square in 2014. It targets Android and JVM developers who want a type-safe, extensible alternative to Gson, with first-class Kotlin support via code generation (kapt/KSP) or reflection. Its key differentiation is a clean adapter model, explicit null handling, and tight integration with Square's broader ecosystem (OkHttp, Retrofit). It is widely used in Android development and has a loyal installed base, though Kotlin Multiplatform projects increasingly favor kotlinx.serialization.
Created by Square in August 2014 as a cleaner alternative to Gson, Moshi evolved from a Java-centric library to a Kotlin-first one, adding KSP-based code generation and Kotlin data class support as Android development shifted to Kotlin.
Moshi grew on the coattails of Square's dominant Android networking stack (OkHttp + Retrofit). Its growth peaked around 2018–2021 as Android moved to Kotlin and Moshi added native Kotlin support. Star velocity has slowed to near zero recently, reflecting category maturity rather than decline — the library is widely installed and stable, not in a growth phase.
Moshi has verifiable production usage at scale: it is the recommended JSON library in numerous Android codebases, widely referenced in Retrofit documentation and tutorials, and used within Square's own apps. Stack Overflow questions, GitHub dependency graphs, and Android blog posts confirm broad real-world use. Adoption is not speculative — it is a well-established library in the Android ecosystem.
Appears to use a builder-pattern Moshi instance with a chain-of-responsibility adapter registry. Likely supports three modes: Java reflection, Kotlin reflection (via KotlinJsonAdapterFactory), and compile-time code generation (KSP). Custom adapters use @ToJson/@FromJson annotations. Architecture appears modular, separating core, kotlin, adapters, and codegen artifacts.
Not documented in README
Last push was June 19, 2026 — approximately 7 days before the evaluation date — indicating active maintenance. The project has 805 forks and 10,141 stars accumulated over a decade. Slow star accumulation in recent weeks reflects market saturation, not neglect. Square continues to maintain it alongside their broader OSS portfolio.
ADOPT IF: you are building an Android or JVM-only Kotlin/Java application and want a battle-tested JSON library with strong Kotlin data class support, a clean custom adapter model, and deep integration with Retrofit/OkHttp. AVOID IF: you are starting a Kotlin Multiplatform project or need JSON serialization across non-JVM targets — kotlinx.serialization is a better fit there. MONITOR IF: you have an existing Moshi codebase and are considering migration to kotlinx.serialization; the migration cost is real and likely not justified unless you need KMP.
Independent dimensions
Mainstream potential
4/10
Technical importance
7/10
Adoption evidence
8/10
- No Kotlin Multiplatform support limits adoption in the KMP ecosystem, which is growing rapidly and drawing new Kotlin projects away from JVM-only libraries.
- JetBrains actively promotes kotlinx.serialization as the canonical Kotlin serialization solution, which may reduce Moshi's mindshare among developers starting new Kotlin projects.
- Star growth has effectively stalled, suggesting the library is past its adoption growth phase. Continued maintenance is likely but major new features or ecosystem expansion appear unlikely.
- Reflection-based usage on Kotlin classes is explicitly unsupported, requiring developers to add codegen (kapt/KSP) or KotlinJsonAdapterFactory — this adds build configuration complexity compared to simpler alternatives.
- Square's OSS portfolio is large; there is a non-zero risk of reduced investment if internal usage at Square shifts toward KMP or other stacks, though no public signals of this exist currently.
Moshi will remain actively maintained and widely used in existing Android codebases for years. New project adoption will likely continue declining slowly as kotlinx.serialization captures KMP and new-project mindshare, but Moshi's installed base is too large to disappear soon.
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Language
- Kotlin
- License
- Apache-2.0
- Last updated
- 14h ago
- Created
- 145mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Open issues
Top contributors
Recent releases
No releases published yet.
Similar repos
Kotlin/kotlinx.serialization
Kotlin multiplatform serialization library providing reflectionless,...
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
10.1k | +1 | Kotlin | 8/10 | 14h ago |
|
|
5.9k | — | Kotlin | 9/10 | 3w ago |
|
|
9k | — | Kotlin | 8/10 | 6d ago |
|
|
47k | — | Kotlin | 9/10 | -54 min ago |
|
|
2.7k | — | Java | 8/10 | 22h ago |
|
|
24.2k | — | Java | 8/10 | 1mo ago |
Gson is older and more widely known historically but has been in maintenance-only mode since ~2022. Moshi has better Kotlin support, stricter null safety, and more active development. Gson still has a larger raw install base due to legacy projects.
The primary alternative for new Kotlin projects, especially Kotlin Multiplatform. It is JetBrains-backed, requires no reflection, and works on all KMP targets. For Android-only or JVM projects, the two are roughly equivalent; for KMP, kotlinx.serialization is the clear default. Moshi has no KMP support.
Not a direct competitor — OkHttp is an HTTP client. Mentioned as context: Moshi integrates naturally as the serialization layer in the OkHttp/Retrofit stack, which is a key adoption driver.
Jackson is more feature-complete for complex enterprise Java use cases (streaming, tree model, data binding, XML). Moshi is lighter and more focused. For Android, Moshi's smaller footprint and cleaner API are advantages; for complex backend Java workloads, Jackson is likely preferred.
Unrelated project sharing the name — it is a Python-based speech/audio model. No technical relationship to square/moshi.