JSON-Utils

JSON to Java

Generate Java types from a JSON sample: Java 21 records, or classic POJOs with getters and setters. Jackson @JsonProperty annotations are added whenever a field name differs from the JSON key, Lombok is available as an option, and nested objects become their own types.

JSON
Java
Result will appear here
Ready. Press Generate or Ctrl+Enter.

How to use the JSON to Java

  1. Paste a JSON sample.
  2. Choose records or POJOs, toggle Jackson and Lombok.
  3. Press Generate and copy the code.

Example

Try a snake_case key to see the @JsonProperty annotation appear.

{
  "name": "json-utils",
  "version": "1.0.0",
  "private": false,
  "tags": ["json", "tools"],
  "author": { "name": "Ada", "active": true },
  "score": 9.5,
  "notes": null
}

Frequently asked questions

Which Java version?

Records need Java 16 or later; the output targets modern Java (21). POJO output works on older versions too.

How are numbers typed?

Whole numbers become long (or Long in POJOs) and decimals become double (or Double), which is the safe default for unknown ranges.