Class or record
Classic POJOs with private fields, getters and setters, or compact Java 16+ records.
Create Java POJOs or records with Jackson annotations from example JSON.
Generate Java POJOs with getters and setters, or Java records, from JSON. Jackson @JsonProperty for renamed keys and nested static classes.
{"id":7,"userName":"aarav","tags":["a"]}import java.util.List;
public record User(
Integer id,
String userName,
List<String> tags
) {}Tip: Records are immutable and need no getters, which makes them a good fit for DTOs on Java 16 and later.
Classic POJOs with private fields, getters and setters, or compact Java 16+ records.
Keys that are renamed for Java (user_name → userName) get @JsonProperty with the original key.
Nested objects become public static nested classes or records in the same file.
Integer, Long, Double, Boolean and List<T> so missing values can be null.
JSON fields can be missing or null; Integer and Double can hold null where int cannot.
Jackson, through @JsonProperty. Gson users can replace it with @SerializedName.
ISO date-times become OffsetDateTime and dates LocalDate; register Jackson's JavaTimeModule to deserialize them.
No, generation happens in your browser.