What is JSON → Java?
Generate Java POJO classes from JSON data instantly. Choose between Jackson, Gson, or Lombok annotations.
Nested objects become their own classes with Jackson annotations, getters and setters. Output updates as you type, and everything runs in your browser.
Features
- Generate Java POJOs from JSON
- Jackson, Gson, and Lombok annotation support
- Private fields with getters and setters
- toString, equals, and hashCode methods
- Handles nested objects and collections
- Copy generated code to clipboard
How to use JSON → Java
- Paste your JSON. Enter a sample JSON object representing your API response.
- Select framework. Choose Jackson, Gson, or Lombok for annotations.
- Copy Java code. Get production-ready Java classes.
Examples
Generating Java classes
A small user record with a nested address, generated with the default settings. Trimmed to the start of the Root class (first 25 lines). The generator also emits Address.java and a Converter class.
Input
{
"id": 1,
"name": "Ada Lovelace",
"email": "ada@example.com",
"active": true,
"tags": ["admin", "dev"],
"address": { "city": "London", "zip": "EC1A" }
}Output
// Root.java
package com.example;
import com.fasterxml.jackson.annotation.*;
import java.util.List;
public class Root {
private long id;
private String name;
private String email;
private boolean active;
private List<String> tags;
private Address address;
@JsonProperty("id")
public long getID() { return id; }
@JsonProperty("id")
public void setID(long value) { this.id = value; }
@JsonProperty("name")
public String getName() { return name; }
@JsonProperty("name")
public void setName(String value) { this.name = value; }
@JsonProperty("email")Frequently asked questions
What annotations are supported?
Jackson (@JsonProperty), Gson (@SerializedName), and Lombok (@Data, @Builder) annotations.
Can I use this for Android?
Yes. Generated POJOs work with Retrofit, Volley, and other Android networking libraries.
