# Gson

> Google's Java library for converting objects to and from JSON

Source: https://talira.ai/catalog/gson-gym31c30
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / parsing / json](https://talira.ai/categories/developer-tools/parsing/json), [languages / java](https://talira.ai/categories/languages/java)
- Licence: Apache-2.0[^2]
- Pricing: Free and open source[^2]
- Free tier: yes[^2]
- Backed by: [Google](https://talira.ai/orgs/google.md)
- Funding: public company (NASDAQ:GOOGL)[^3]

Gson is Google's Java library for converting Java objects to JSON and back with `toJson()` and `fromJson()`. It works with arbitrary objects, including pre-existing classes you don't have the source for, without annotations, and fully supports Java generics and custom representations. It's in maintenance mode, and its README recommends a library with explicit support for Kotlin, and Kotlin Serialization on Android, where Gson's reflection clashes with code shrinking.

## Links

- Website: https://google.github.io/gson/
- GitHub: https://github.com/google/gson
- Docs: https://www.javadoc.io/doc/com.google.code.gson/gson

## Problems it solves

- turn my Java objects into JSON and parse JSON back without annotating every class
- serialize objects from a third-party library I can't change to JSON in Java
- parse JSON into generic Java collections

## Features

- convert Java objects to JSON and back with toJson and fromJson
- works with classes you can't annotate
- full support for Java generics
- custom serializers and type adapters

## Limitations

- Not recommended on Android: its reflection breaks under R8 and ProGuard shrinking and obfuscation in release builds.[^1]
- Kotlin-specific features such as non-null types and default constructor arguments aren't supported.[^1]
- In maintenance mode: bugs are fixed, but large new features are unlikely.[^1]

## Trust

Overall: 0.74 out of 1.
Signals: maintenance 0.92, adoption 0.88, momentum 0.68, community 0.92, backing 0.55, extensibility 0.00.

- last commit 8 days ago
- 48 commits in the last 90 days
- latest release gson-parent-2.15.0 37 days ago
- 24.2k GitHub stars
- 201 contributors
- backed by Google
- funding: public company (NASDAQ:GOOGL)

## Alternatives

- [Jackson](https://talira.ai/catalog/jackson-4j3s0grs.md): The Java JSON library: a suite of data-processing tools for Java and the JVM
- [FASTJSON 2](https://talira.ai/catalog/fastjson-2-bbdzeh74.md): High-performance JSON library for Java, the successor to fastjson
- [Moshi](https://talira.ai/catalog/moshi-6f1zqsd4.md): A modern JSON library for Android, Java and Kotlin
- [JSON-java (org.json)](https://talira.ai/catalog/json-java-org-json-q1cbb2tt.md): The reference JSON implementation for Java, in the public domain
- [json](https://talira.ai/catalog/json-r9196zbp.md): Ruby's JSON parser and generator, shipped with Ruby as a default gem
- [Jayway JsonPath](https://talira.ai/catalog/jayway-jsonpath-1r1563tt.md): Query and update JSON documents in Java with XPath-like JsonPath expressions

## Sources

[^1]: https://github.com/google/gson/blob/main/README.md (checked 26 Nov 2026)
[^2]: https://github.com/google/gson/blob/main/LICENSE (checked 26 Nov 2026)
[^3]: https://www.sec.gov/files/company_tickers_exchange.json (checked 20 Nov 2026)
