🌐
GitHub
github.com › google › gson
GitHub - google/gson: A Java serialization/deserialization library to convert Java Objects into JSON and back · GitHub
Design document: This document discusses issues we faced while designing Gson. It also includes a comparison of Gson with other Java libraries that can be used for Json conversion
Starred by 24.3K users
Forked by 4.4K users
Languages   Java
open-source Java library to serialize and deserialize Java objects to and from JSON
Gson, or Google Gson, is an open-source Java library that serializes Java objects to JSON (and deserializes them back to Java). The Gson library was originally developed for internal purposes at Google, … Wikipedia
Factsheet
Google Gson
Developer Google
Initial release May 22, 2008; 17 years ago (2008-05-22)
Factsheet
Google Gson
Developer Google
Initial release May 22, 2008; 17 years ago (2008-05-22)
🌐
Javadoc.io
javadoc.io › doc › com.google.code.gson › gson › 2.8.0 › com › google › gson › Gson.html
Gson - gson 2.8.0 javadoc
Bookmarks · Latest version of com.google.code.gson:gson · https://javadoc.io/doc/com.google.code.gson/gson · Current version 2.8.0 · https://javadoc.io/doc/com.google.code.gson/gson/2.8.0 · package-list path (used for javadoc generation -link option) · https://javadoc.io/doc/com.goog...
🌐
GitHub
google.github.io › gson › UserGuide.html
Gson User Guide | gson
The default behaviour that is implemented in Gson is that null object fields are ignored. This allows for a more compact output format; however, the client must define a default value for these fields as the JSON format is converted back into its Java form.
🌐
TutorialsPoint
tutorialspoint.com › gson › gson_quick_guide.htm
GSON - Quick Guide
It prepares an in-memory tree representation of the JSON document. It builds a tree of JsonObject nodes. It is a flexible approach and is analogous to DOM parser for XML. It converts JSON to and from POJO (Plain Old Java Object) using property ...
🌐
Javadoc.io
javadoc.io › doc › com.google.code.gson › gson › latest › index.html
gson 2.13.2 javadoc (com.google.code.gson)
Latest version of com.google.code.gson:gson · https://javadoc.io/doc/com.google.code.gson/gson · Current version 2.13.2 · https://javadoc.io/doc/com.google.code.gson/gson/2.13.2 · package-list path (used for javadoc generation -link option) https://javadoc.io/doc/com.google.code.gson/gson/2.13.2/package-list ·
🌐
ZetCode
zetcode.com › java › gson
Java Gson - JSON serialization and deserialization in Java with Gson
October 10, 2024 - Gson tutorial shows how to work with JSON in Java using Gson library. We use three different Gson APIs to work with JSON.
🌐
Readthedocs
jse.readthedocs.io › en › latest › utils › gson › index.html
Gson — Java Repositories 1.0 documentation - Read the Docs
Java Repositories 1.0 documentation · Show source · Suggest edit · Open issue · .rst · .pdf · Gson · Goals · Download · Documentation · References · Convert JSON to a Map · Passing Map.class · Using TypeToken · Using Custom JsonDeserializer · Results · References ·
🌐
Maven Repository
mvnrepository.com › artifact › com.google.code.gson › gson
Maven Repository: com.google.code.gson » gson
September 10, 2025 - Gson is a Java library that can be used to convert Java Objects into their JSON representation.
Find elsewhere
🌐
HowToDoInJava
howtodoinjava.com › home › gson › gson tutorial: read and write json with examples
Gson Tutorial: Read and Write JSON with Examples
August 27, 2023 - Excluding Fields From Serialization and Deserialization – Gson supports numerous mechanisms for excluding top-level classes, fields and field types. Learn how to use them. JsonReader – Streaming JSON parser – Learn to read a JSON string or file as a stream of JSON tokens. JsonParser, JsonElement and JsonObject – Learn to parse a JSON string or stream into a tree structure of Java objects into JsonElement.
🌐
DZone
dzone.com › coding › frameworks › json handling with gson in java with oop essence
JSON Handling With GSON in Java With OOP Essence
January 4, 2024 - GSON is a popular Java library that provides easy-to-use APIs to serialize and deserialize Java objects to and from JSON (JavaScript Object Notation) format. One of the key features of GSON is its ability to handle inheritance and polymorphism ...
🌐
Javadoc.io
javadoc.io › doc › com.google.code.gson › gson › latest › com.google.gson › module-summary.html
com.google.gson module summary - gson 2.13.2 javadoc
Bookmarks · Latest version of com.google.code.gson:gson · https://javadoc.io/doc/com.google.code.gson/gson · Current version 2.13.2 · https://javadoc.io/doc/com.google.code.gson/gson/2.13.2 · package-list path (used for javadoc generation -link option) · https://javadoc.io/doc/com.go...
🌐
GitHub
github.com › google › gson › blob › main › UserGuide.md
gson/UserGuide.md at main · google/gson
The default behaviour that is implemented in Gson is that null object fields are ignored. This allows for a more compact output format; however, the client must define a default value for these fields as the JSON format is converted back into its Java form.
Author   google
🌐
IronPDF
ironpdf.com › ironpdf for java › ironpdf for java blog › java help › gson java
Gson Java (How It Works For Developers)
June 23, 2025 - Serialize Data with Gson: Begin by using Gson to serialize your Java objects into JSON format. This JSON data will serve as the content for your PDF document.
🌐
Vogella
vogella.com › tutorials › JavaLibrary-Gson › article.html
Google Gson for converting Java objects to JSON and JSON to Java with - Tutorial
3 weeks ago - This tutorial explains how to use the Open Source framework Gson from Google to usage and purpose of Java JAR files.
🌐
Wikipedia
en.wikipedia.org › wiki › Gson
Gson - Wikipedia
October 30, 2025 - package main; import example.Car; import example.Person; import com.google.gson.Gson; import com.google.gson.GsonBuilder; public class Main { public static void main(String[] args) { // Enable pretty printing for demonstration purposes // Can also directly create instance with `new Gson()`; this will produce compact JSON Gson gson = new GsonBuilder().setPrettyPrinting().create(); Car audi = new Car("Audi", "A4", 1.8, false); Car skoda = new Car("Škoda", "Octavia", 2.0, true); Car[] cars = {audi, skoda}; Person johnDoe = new Person("John", "Doe", 2025550191, 35, cars); System.out.println(gson.toJson(johnDoe)); } }
🌐
GitHub
google.github.io › gson
Gson | gson
Design document: This document discusses issues we faced while designing Gson. It also includes a comparison of Gson with other Java libraries that can be used for Json conversion
🌐
Java Guides
javaguides.net › p › google-gson-tutorial.html
Google GSON Tutorial
May 29, 2022 - GSON - Serialize and Deserialize Primitives Types - In this quick article, we will discuss how to use GSON to serialize or deserialize any primitive type into JSON representation. Convert Java Object to JSON using GSON - In this article, we will create an example of converting or serializing Java objects to JSON representation using the GSON library.
🌐
GitHub
google.github.io › gson › gson › src › main › java › com › google › gson › Gson.java
Gson
When using an existing {@code JsonReader}, manually apply the reader settings of this * {@code Gson} instance listed by {@link #newJsonReader(Reader)}. * Otherwise, when not using an existing {@code JsonReader}, use {@link * #newJsonReader(Reader)} to construct one. * ... Call {@link JsonReader#peek()} and verify that the result is {@link JsonToken#END_DOCUMENT} * to make sure there is no trailing data * * * Note that the {@code JsonReader} created this way is only 'legacy strict', it mostly adheres to * the JSON specification but allows small deviations.