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

  1. Paste a representative JSON object.
  2. Set the root class name and choose options (Lombok, field visibility).
  3. 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.
Contact

Let’s connect

Have a Liferay or Backend project you’d like to talk through? Fill in the form and I’ll get back to you.

Book Calendar