JSON to Java POJO

Generate Java POJOs from JSON with Jackson @JsonProperty annotations. Includes getters and setters. For Lombok projects, replace the boilerplate with @Data or @Value on the class.

How to use the JSON to Java POJO

Paste JSON. Output uses Jackson. For Gson, replace @JsonProperty with @SerializedName. For records (Java 17+), the structure can collapse to a single line per record — adjust manually if you want that style.

Generating Java POJOs from JSON

Mapping a JSON API into Java means POJOs — a class per object, with fields, getters, setters, and the serializer annotations that bind them to the JSON keys. It is the most boilerplate-heavy of the JVM languages to do by hand, and the kind of repetitive work that invites copy-paste mistakes.

This generates Java POJOs from a JSON sample using Jackson @JsonProperty annotations, complete with getters and setters, and a class for each nested object. If you use Lombok, replace the boilerplate with @Data or @Value; if you use Gson, swap to @SerializedName. On Java 17 and later you can collapse simple classes into records. The Kotlin generator is the leaner JVM alternative.

Common use cases

  • Map an API — generate POJOs from a sample response.
  • Jackson ready — get @JsonProperty annotations and accessors.
  • Lombok projects — replace the boilerplate with @Data or @Value.
  • Nested classes — produce a class for each nested object.
  • Records — collapse simple classes to Java 17 records where it fits.

Frequently asked questions

Which JSON library does it target?

Jackson, using @JsonProperty annotations with generated getters and setters.

What if I use Gson instead?

Replace @JsonProperty with @SerializedName; the rest of the class is unchanged.

Can I reduce the boilerplate?

Yes — with Lombok use @Data or @Value, and on Java 17 or later collapse simple classes into records.

Is there a less verbose JVM option?

The Kotlin generator produces compact data classes for the same JVM.
Embed this tool on your site

Free to embed, no attribution required (but appreciated). Paste this where you want the tool to appear: