JSON to Java Class / Record Generator
Convert JSON into Java POJOs (Lombok @Data) or records — with nested types, List generics and Jackson @JsonProperty for snake_case keys. Perfect for building Spring Boot DTOs fast.
About this tool
Building a Spring Boot DTO from a third-party JSON response usually means transcribing every field into a Java class, matching types by hand and adding annotations. This generator does that in one step: paste the JSON and get a Java class or record back, with nested types, List generics and Jackson annotations wired in.
It is designed for how backend teams actually work. Pick Lombok @Data classes to cut boilerplate, or immutable records for modern APIs. Snake_case keys are mapped to camelCase Java fields with @JsonProperty so deserialization stays correct, and nested JSON objects become their own generated types rather than a flat blob.
How to use
- Copy a sample JSON payload — an API response or a fixture works well.
- Paste it into the input panel of the generator.
- Choose the output style: Lombok @Data class or Java record.
- The generated Java types appear instantly, including nested classes.
- Adjust the root type name to match your DTO naming convention.
- Copy the result into your Spring Boot project's model package.
Features
- Generates either Lombok @Data classes or immutable Java records.
- Nested JSON objects become separate, correctly referenced types.
- Arrays map to List with the right generic element type.
- Snake_case keys get @JsonProperty so Jackson binds them properly.
- Java field names follow camelCase conventions automatically.
- Tuned for fast Spring Boot DTO creation.
- All generation happens in the browser — your JSON is never uploaded.
Frequently asked questions
Does my JSON get sent to a server?
No. The class generation runs locally in your browser with JavaScript. Payloads that may contain sensitive fields stay entirely on your machine.
Should I choose a class or a record?
Records are concise and immutable, ideal for read-only DTOs on modern Java. Lombok @Data classes are mutable with generated getters and setters, which some codebases and frameworks still expect. Pick whichever matches your project's conventions.
How are snake_case JSON keys handled?
A key like created_at becomes a Java field createdAt annotated with @JsonProperty("created_at"), so Jackson serializes and deserializes to the original JSON name while your Java stays idiomatic.
What happens with nested objects and arrays?
Each nested object becomes its own generated type, and JSON arrays are mapped to List with the inferred element type as the generic parameter.
Can I use the output outside Spring Boot?
Yes. The generated classes and records are plain Java plus Jackson and, optionally, Lombok annotations. They work in any Java project that uses those libraries, not only Spring Boot.