google/gson

A Java serialization/deserialization library to convert Java Objects into JSON and back

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 32 minutes ago
Added to GitGenius on August 2nd, 2026
Created on March 19th, 2015
Open Issues & Pull Requests: 343 (+0)
GitHub issues: Enabled
Number of forks: 4,462
Total Stargazers: 24,236 (+0)
Total Subscribers: 738 (+0)

Issue Activity (beta)

Open issues: 52
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,580 days
Stale 30+ days: 46
Stale 90+ days: 44

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 2
Events in 7 days: 2

Top labels

  • bug (64)
  • enhancement (46)
  • needs-info (21)
  • proguard-r8 (7)
  • java8 (6)
  • Priority-Medium (5)
  • Type-Enhancement (5)
  • kotlin (5)

Most active issues this week

Repository Insights (GitGenius)

Median issue/PR response: 0.0 hours
Mean response time: 195.1 days
90th percentile: 733.4 days
Tracked items: 137

Most active contributors

Detailed Description

Gson is a Java library developed by Google that converts Java objects to JSON representation and vice versa. The library provides straightforward toJson() and fromJson() methods for bidirectional serialization and deserialization, making it a practical choice for Java developers who need to work with JSON data. A key distinguishing feature of Gson is its ability to work with pre-existing objects and classes for which you do not have access to source code, eliminating the need to add annotations to your classes before serialization.

The design philosophy of Gson prioritizes two important goals that set it apart from competing Java JSON libraries. First, it supports arbitrary Java objects without requiring modifications to existing code, which is particularly valuable when working with third-party libraries or legacy systems. Second, Gson provides extensive support for Java Generics, a feature that many alternative JSON libraries do not fully implement. The library can handle arbitrarily complex objects, including those with deep inheritance hierarchies and extensive use of generic types, making it suitable for sophisticated data structures.

Gson is currently maintained in maintenance mode, meaning that existing bugs will be fixed but large new features are unlikely to be added. This status reflects the library's maturity and stability after years of production use. The project is available through Maven Central, and Gson 2.12.0 and newer require Java 8 as a minimum version, though older versions support Java 6 and 7. For Java 9 and newer users, Gson provides a JPMS module descriptor with the module name com.google.gson, and it includes optional support for SQL date and time classes when the java.sql module is present.

The repository includes important caveats regarding usage outside of traditional Java environments. While Gson may function with other JVM languages such as Kotlin and Scala, language-specific features are not supported, which can lead to confusing behavior. Additionally, Google explicitly recommends against using Gson on Android due to its reliance on runtime reflection, which conflicts with the shrinking, optimization, and obfuscation passes that Android release applications should perform. For Android development, Kotlin Serialization is recommended as a superior alternative that uses code generation instead of reflection.

Building Gson requires JDK 17 or newer, with JDK 21 being the recommended version for development. The project uses Maven as its build system and is released under the Apache 2.0 license. Comprehensive documentation is available, including API Javadoc, a user guide, a troubleshooting guide covering ProGuard and R8 integration, and a design document that discusses the architectural decisions made during development. The project maintains active community engagement through StackOverflow, GitHub Discussions, and a dedicated Google group for users to ask questions and discuss the library.

gson
by
googlegoogle/gson

Repository Details

Fetching additional details & charts...