JSON to Java POJO Generator
Generate Java POJO classes from JSON. Pick Jackson or Gson annotations, configure package name, and download ready-to-compile classes.
Output will appear here…Generate Java POJOs from JSON
Mapping JSON to Java classes by hand is one of the most tedious parts of writing a Java backend. Every API response needs a corresponding class, every field needs the right type, and every field needs a Jackson or Gson annotation to preserve the original JSON key (because Java convention is camelCase but JSON keys are usually snake_case). Lintify does all of that automatically — paste a sample JSON, pick your library and package, and download ready-to-compile Java classes.
Each generated class has private fields with public getters and setters, which is the standard JavaBean convention. Jackson's@JsonPropertyannotation (or Gson's@SerializedName) is added to every field so that the JSON key is preserved during serialization and deserialization. The result is a class you can use directly with ObjectMapper.readValue() orGson.fromJson().
Jackson or Gson?
Jackson is the de facto standard in Spring Boot and most enterprise Java codebases — it ships with Spring Boot starter web, has the best performance of any Java JSON library, and supports every JSON feature you will ever need. Pick Jackson if you are starting a new project or if you are not sure.
Gson is lighter and easier to configure for small projects. It is the right pick if you are writing a non-Spring application, if you need to keep your dependency footprint small, or if you are integrating with an existing codebase that already uses Gson. The generated POJOs are structurally identical between Jackson and Gson — only the annotations differ, and you can convert between them with a find-and-replace.
Number types and BigDecimal
Integers become int (or Integerfor nullable fields), large integers becomelong, and decimals becomedouble. For financial data, replacedouble with BigDecimal after generation — double is not safe for money because it cannot represent decimal fractions exactly.BigDecimal is slower but correct, which is the right tradeoff for money.
Nested objects and inner classes
Each nested JSON object becomes a static inner class of its parent by default. This keeps the file count small and groups related classes together. You can refactor inner classes to top-level classes later if a class needs to be reused across multiple endpoints — most IDEs have a one-click refactor for this.
Frequently asked questions
Common questions about the JSON → Java tool.