Generate a POJO Java class with getters/setters from a JSON sample. Part of the DevTools Surf developer suite. Browse more tools in the Converters collection.
Use Cases
Java developers generating model classes from JSON API response samples
Backend teams bootstrapping DTOs for Spring Boot REST controllers
Android developers creating POJO classes for Gson or Moshi deserialization
Enterprise developers generating Java data classes from JSON schema documents
Tips
Paste a JSON sample to auto-generate a Java POJO with getters and setters
Nested objects become separate inner classes automatically
Use the output as a starting point for Jackson or Gson deserialization
Fun Facts
The POJO (Plain Old Java Object) term was coined by Martin Fowler, Rebecca Parsons, and Josh MacKenzie in 2000 to give a name to regular Java objects vs EJBs.
Java's getter/setter convention comes from the JavaBeans specification (1996), which required methods named getX()/setX() for property access in visual builder tools.
Project Lombok, a popular Java library, can auto-generate getters, setters, and constructors with annotations — reducing boilerplate by up to 80% in POJO-heavy codebases.
FAQ
Is it compatible with Jackson?
Yes — default output uses Jackson's `@JsonProperty` annotations. Switch to Gson (`@SerializedName`) or pure POJO (no annotations) in the output options.
Does it generate getters and setters?
Yes for traditional POJOs. For Java 14+ Records, toggle to record style — immutable with accessor methods.
What about Lombok?
Toggle `@Data` or `@Getter`/`@Setter` annotations. Dramatically reduces boilerplate if Lombok is already in your project.
How does it handle unknown JSON fields?
The generated classes are strict — extra JSON fields cause deserialization errors. Add `@JsonIgnoreProperties(ignoreUnknown = true)` manually if you need tolerance.