tools/convert/json → java
// convertnew

json → java

generate java pojos or records from json

drag & drop · up to 5 MB (Pro: 100 MB)
root class:
— paste JSON to start // client-only
// Java classes appear here

// about this tool

Java POJOs (Plain Old Java Objects) are simple classes used to represent data. This tool generates Java class or record definitions from a JSON sample, inferring field types and names automatically. It supports Lombok @Data to eliminate boilerplate getters and setters, and Jackson annotations for JSON property mapping.

// when to use

  • Quickly scaffold a data model from an API response
  • Generate Java records (Java 16+) for immutable data transfer objects
  • Add Jackson @JsonProperty annotations for snake_case JSON keys
  • Add Lombok @Data to eliminate getter/setter boilerplate

// faq

What is the difference between class and record?
Java records (introduced in Java 16) are immutable data carriers with auto-generated constructor, getters, equals, hashCode, and toString. Classes give you full control including mutable fields. Use records for DTOs and value objects; use classes when you need inheritance or mutable state.
Why does the generated code use List instead of arrays?
List<T> is preferred over arrays in modern Java because it is more flexible (resizable), integrates with the Collections API, and works better with Jackson deserialization.
// history
Pro Cloud Sync — upgrade
no operations yet