Paste any JSON and get ready-to-use Java types in one click. Nested objects, arrays, optional fields and awkward key names are handled for you, and everything runs in your browser, so API responses and sample payloads are never uploaded.
Root.JSON input
{
"id": 1,
"name": "Alice",
"active": true,
"score": 98.5,
"tags": ["admin"],
"address": { "city": "New York" }
}Java output
import java.util.List;
public class Root {
private Long id;
private String name;
private Boolean active;
private Double score;
private List<String> tags;
private Address address;
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
public String getName() { return name; }
public void setName(String name) { this.name = name; }
public Boolean getActive() { return active; }
public void setActive(Boolean active) { this.active = active; }
public Double getScore() { return score; }
public void setScore(Double score) { this.score = score; }
public List<String> getTags() { return tags; }
public void setTags(List<String> tags) { this.tags = tags; }
public Address getAddress() { return address; }
public void setAddress(Address address) { this.address = address; }
}
class Address {
private String city;
public String getCity() { return city; }
public void setCity(String city) { this.city = city; }
}| JSON | Java |
|---|---|
| string | String |
| whole number | Long |
| decimal number | Double |
| boolean | Boolean |
| array | List<T> |
| object | a class |
| null / unknown | Object |
Fields are camelCase with getters and setters. When the JSON key differs from the camelCase field name (for example first-name or user_id), the field gets @JsonProperty("original-key") so Jackson maps it back.
ObjectMapper mapper = new ObjectMapper();
Root root = mapper.readValue(jsonString, Root.class);Describe the same data with the JSON Schema generator, get TypeScript interfaces, create a SQL table, fix broken input with JSON Repair, or compare payloads with JSON Diff.
Paste your JSON, set the root class name, and copy the generated Java. Each nested object becomes its own class, arrays become List<T>, and numbers map to Long or Double depending on whether they have a decimal part.
Yes. When a JSON key is not a valid camelCase Java field name (for example first-name or user_id), the generated field gets a @JsonProperty("original-key") annotation so Jackson maps it back correctly.
All fields use boxed types (Long, Double, Boolean) so they can hold null. A field that is null in every sample has no inferable type and becomes Object; if it is null in only some array items, the type comes from the items that do have a value. Everything runs in your browser — your JSON is never uploaded to a server.