JSON has become a famous data format for exchanging information over the Internet. It is commonly used in REST API and for storing loosely structured data. Compared to XML, it is concise, and unfortunately, less human readable. Beautifiers and pretty printers can easily enhance this. I will show you the different options available in GSON to convert an array of objects to a JSON string.