JSON to Java Converter
Paste a JSON object and get ready-to-use Java POJO classes — with field types, nested classes, and optional Lombok or getters/setters.
Last updated: May 27, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is JSON to Java Converter?
When integrating with a JSON-returning API in Java, you typically map the JSON onto a set of POJO classes that a library like Jackson or Gson can deserialize into. Writing the classes by hand is tedious — each field needs a type, a private declaration, and (without Lombok) a getter and a setter.
This tool reads a JSON example and emits the matching class hierarchy. Integer fields use `Integer`, big integers use `Long`, decimals use `Double`, strings use `String`, booleans use `Boolean`, and nested objects produce nested classes. Arrays become `List<T>` where `T` is the inferred element type. Java reserved words and characters that are invalid in identifiers are handled automatically.
How to Use JSON to Java Converter
Paste a JSON object (root must be an object, not an array or primitive).
Set the root class name and an optional package.
Pick a style: Lombok @Data, full getters/setters, or fields-only.
Copy the generated classes into your project.
Common Use Cases
- Bootstrapping Java DTOs from a sample API response.
- Generating model classes for Jackson, Gson, or Moshi deserialization.
- Producing a starting point for a backend Java service consuming JSON.
- Translating an OpenAPI example into POJO classes.
Example Input and Output
A flat JSON object generates a Java POJO with Integer, String, Boolean, and Double fields.
{
"userId": 42,
"name": "Alice",
"active": true,
"score": 87.5
}public class Root {
private Integer userId;
private String name;
private Boolean active;
private Double score;
// getters and setters omitted
}Privacy
All conversion happens in your browser. No JSON is sent to a server.
Reserved keywords
If a JSON key matches a Java keyword (class, public, etc.), the field is renamed with a Field suffix to avoid a compile error. Adjust the renaming manually if you need a different convention.
Jackson annotations
For exact field-name mapping to JSON keys, add @JsonProperty annotations after generation — this tool focuses on the structural class hierarchy.

