JSON to Java Class Generator
Turn JSON into Java POJO classes.
JSON input
Java classes
import java.util.List;
import lombok.Data;
@Data
public class Root {
private Integer id;
private String name;
private Boolean active;
private Double score;
private List<String> roles;
private Address address;
}
@Data
public class Address {
private String city;
private String zip;
}About this tool
Paste a JSON object and generate matching Java classes. Field types are inferred, nested objects become their own classes, and you can optionally emit Lombok annotations to skip getters and setters.
How to use
- Paste a representative JSON object.
- Set the root class name and choose options (Lombok, field visibility).
- Copy the generated Java classes into your project.
Examples
Input
{"id":1,"user":{"name":"Ada","tags":["x"]}}Frequently asked questions
Numbers become Integer/Long/Double, booleans Boolean, strings String, objects nested classes, and arrays List<T> based on the first element.
Yes. Toggle Lombok to add @Data (and friends) instead of generating explicit getters and setters.