Convert JSON to Java classes — Lombok or Records
Paste JSON and get Java model classes back instantly. Choose Lombok-annotated POJOs for mutable beans with generated getters, setters, equals, and hashCode, or Java Records for immutable value types. Field types are inferred from the data, nested objects become their own classes, and Jackson @JsonProperty annotations preserve the original JSON key names.
Output formats: Lombok (@Data class — getters, setters, equals, hashCode, toString), Record (Immutable Java 16+ record with compact components).
| Option | What it does |
|---|---|
| Root Class Name | Names the top-level POJO. |
| Package Name (optional) | Emitted as a package declaration at the top of each file. |
| Field Naming Convention | One of camelCase, PascalCase, Preserve Original. Defaults to camelCase. |
| Type for null values | Either Object or String, used when a key is null in every sample. |
| Use Primitives | Emit int / long / double / boolean instead of their wrapper classes. |
| Separate Classes | Write each nested object to its own file instead of nesting it as a static inner class. |
| Add @JsonProperty | Annotate fields with the original JSON key so Jackson maps them correctly. |
| Add @Builder | Add Lombok's @Builder for fluent construction. |
| JSON value | Java type |
|---|---|
| string | String |
| integer | Integer (int) |
| integer beyond 32 bits | Long (long) |
| decimal | Double (double) |
| true / false | Boolean (boolean) |
| ISO-8601 timestamp | LocalDateTime |
| array | List<T> |
| object | nested class |
| null | Object (configurable) |
{
"id": 12345,
"product_name": "Wireless Mouse",
"price": 24.99,
"in_stock": true,
"tags": ["electronics", "accessories"],
"manufacturer": {
"name": "Acme Corp",
"country": "US"
}
}
@Data
public class Product {
@JsonProperty("id")
private Integer id;
@JsonProperty("product_name")
private String productName;
@JsonProperty("price")
private Double price;
@JsonProperty("in_stock")
private Boolean inStock;
@JsonProperty("tags")
private List<String> tags;
@JsonProperty("manufacturer")
private Manufacturer manufacturer;
}
Lombok output is a mutable class annotated with @Data, which generates getters, setters, equals, hashCode, and toString at compile time — use it when a framework needs a no-arg constructor and setters. Record output is an immutable Java 16+ record whose components are final and whose accessors are named after the field. Records are shorter but cannot be mutated after construction.
Only if you leave @JsonProperty enabled. Those annotations come from Jackson (com.fasterxml.jackson.annotation) and map a JSON key like product_name onto a Java field named productName. Turn the option off if you deserialize with something else or your keys already match your field names.
No. Parsing, type inference, and code generation all run in your browser using JavaScript. Your JSON is never sent to a server, and there is no account, tracking, or storage beyond your own browser.
No. The generator is free to use with no sign-up and no usage limits.
Each nested JSON object becomes its own named type, derived from the key it appeared under. Arrays of objects are widened across every element, so a field that is a whole number in one element and a fraction in another gets a type that holds both.