JSON to Java

Paste a JSON sample, such as an API response, to generate Java classes for it. Choose plain POJOs, Lombok or records. Nested objects become their own classes and odd key names get @JsonProperty.

JSON
Java

    
Ready

Questions

How are types chosen?

Text becomes String, whole numbers become Integer or Long if they are too big, decimals become Double, and arrays become List. In arrays of objects, all items are merged so every field that appears is included.

Why are wrapper types the default?

JSON fields can be missing or null. Integer can hold null but int cannot, so it would quietly become 0. Use primitive types only when every field is always present.

Which style should I pick?

Records (Java 16+) are short and immutable and work with Jackson 2.12+. Lombok's @Data keeps classes short if your project already uses Lombok. POJOs work everywhere with no extra dependencies.

Is my JSON uploaded?

No. Classes are generated in your browser and your data stays on your device.