JSON to Java POJO Generator
Convert JSON to Java POJO classes online with Jackson annotations, getters and setters or Lombok, List<T> collections and your own package name. Free and private.
🔒 Runs entirely in your browser — nothing is uploadedGenerate Java POJOs from JSON
Mapping a JSON API to Java usually means writing a stack of plain old Java objects with private fields, getters, setters and annotations. This JSON to Java converter generates them from a sample in a second. Each JSON object becomes a class, each key becomes a camelCase field annotated with @JsonProperty so Jackson maps it to the original name, nested objects become their own classes, and arrays become List<T> or T[]. Date-time strings are detected and typed with the java.time API, and numbers are split into long and double based on the values seen.
The engine is quicktype, which considers every element of an array before inferring a type. A field that appears in only some items still lands in the class, so deserializing the full response does not fail on unknown properties.
Jackson, Lombok and packages
The default output targets Jackson, the most widely used JSON library in Spring Boot and the wider Java ecosystem, and includes a converter class with fromJsonString and toJsonString helpers. If you only want data classes, tick Classes only. Enable Use Lombok to trade explicit accessors for Lombok annotations and keep each class compact. Set the package name so the generated code matches your source tree, and rename the root class to reflect your domain, for example CustomerResponse.
Tips for better Java models
Provide a sample with optional fields filled in and with several array items, because inference can only describe values that are present. Empty arrays or null values become Object, which you will want to replace. After generation, split the output into one file per public class if your build requires it, review numeric ranges and currency fields that should be BigDecimal, and convert well-known strings to enums. Since conversion happens locally in the browser, it is safe to paste internal payloads.
How to use
- Paste JSONPaste a JSON document or load the sample to see how it works.
- ConfigureSet the root class name, package, collection type and Lombok preference.
- Copy the POJOsCopy the Java classes or download them as a .java file.
Frequently asked questions
Which JSON library does the output use?
@JsonProperty and include a small converter class. Tick Classes only to get plain POJOs.Can it generate Lombok classes?
Does it use List or arrays?
List<T> for collections or T[] for plain arrays.