Open huge JSON files instantly. Free & private.🔒 Your data never leaves your browser

JSON to Java

Convert JSON to Java records or classes (POJOs) with Jackson @JsonProperty annotations, in one file you can paste and compile.

JSON
Java

How the Java classes are built

  • Output is a single file: the other types are nested inside Root, so you can paste it as Root.java and compile.
  • Every field has a Jackson @JsonProperty with the original key, and @JsonIgnoreProperties(ignoreUnknown = true) so new fields in the API don't break your code.
  • Boxed types (Integer, Boolean) are used so missing values and null become null. Numbers too big for int become Long.

Read JSON with Jackson

ObjectMapper mapper = new ObjectMapper();
Root data = mapper.readValue(json, Root.class);

Records need Jackson 2.12 or newer.

Smart type detection

Objects inside arrays are merged into one type, so a key that appears in only some items is still included (as optional). Names come from the keys, and plural keys become singular: comments → Comment. Whole numbers and decimals in the same field become a decimal type. Everything runs in your browser; your JSON is never uploaded.

More free tools