JSON to Java POJO
Generate Java POJOs from JSON with Jackson @JsonProperty annotations. Includes getters and setters. For Lombok projects, replace the boilerplate with @Data or @Value on the class.
How to use the JSON to Java POJO
Paste JSON. Output uses Jackson. For Gson, replace @JsonProperty with @SerializedName. For records (Java 17+), the structure can collapse to a single line per record — adjust manually if you want that style.
Generating Java POJOs from JSON
Mapping a JSON API into Java means POJOs — a class per object, with fields, getters, setters, and the serializer annotations that bind them to the JSON keys. It is the most boilerplate-heavy of the JVM languages to do by hand, and the kind of repetitive work that invites copy-paste mistakes.
This generates Java POJOs from a JSON sample using Jackson @JsonProperty annotations, complete with getters and setters, and a class for each nested object. If you use Lombok, replace the boilerplate with @Data or @Value; if you use Gson, swap to @SerializedName. On Java 17 and later you can collapse simple classes into records. The Kotlin generator is the leaner JVM alternative.
Common use cases
- Map an API — generate POJOs from a sample response.
- Jackson ready — get
@JsonPropertyannotations and accessors. - Lombok projects — replace the boilerplate with
@Dataor@Value. - Nested classes — produce a class for each nested object.
- Records — collapse simple classes to Java 17 records where it fits.