1
Input JSON
Paste or edit JSON
2
Java Class Code
Online JSON to Java Class (JavaBean / POJO) Code Generator
Paste JSON data on the left to automatically generate entity class code conforming to the JavaBean specification, including private fields and standard Getter/Setter methods.
Supports nested objects (auto-generates inner classes) and array mapping (generates List<T>). Compatible directly with Jackson, Gson, Fastjson, etc. All conversions are done locally in your browser, and data is never uploaded to servers.
Features
- Auto-generates private fields + Getter/Setter, conforming to JavaBean specs
- Recursively generates corresponding inner classes for nested objects
- Maps JSON arrays to
List<T>generics - Supports automatic conversion of
snake_casefield names tocamelCase - Customizable root class name, supports outputting multiple classes simultaneously
Applicable Scenarios
- Spring Boot Dev: Quickly generate entity classes for REST API JSON responses
- 3rd-Party API Integration: Convert example JSON from API docs to usable Models
- Database Queries: Map MyBatis JSON fields to object mapping classes
- Android Dev: Generate data models for Retrofit API responses
Frequently Asked Questions
Yes. The tool recursively parses nested JSON objects, generates independent Java classes for each, and references them in the outer class to preserve the hierarchy.
Yes. It follows standard specs. If you need Jackson annotations (e.g.,
@JsonProperty), you can manually add them after generation.JSON arrays are mapped to Java's
List<T> generic type. Arrays of basic types convert to List<String> or List<Integer>; arrays of objects generate corresponding subclasses and convert to List<SubClass>.Completely safe. All parsing and code generation happen locally in your browser. Data is never uploaded to any server, and it works offline.