JSON to Java POJO
Generate Java POJO classes from JSON instantly. Supports Jackson, Gson, and Lombok annotations. Handles nested objects, arrays, and custom root class names. Free, runs in your browser.
How to Use
- Paste or type your JSON into the left panel. The tool validates it in real time.
- Optionally set a Root class name (default:
RootObject). - Choose an annotation mode: None, Jackson, Gson, or Lombok (@Data).
- Click Generate Java or wait for real-time conversion.
- Click Copy to copy the output to your clipboard.
Type Mapping
null→Object- string →
String - integer number →
int - floating-point number →
double - boolean →
boolean - array →
List<T> - nested object → separate
public class
Example
Given this JSON:
{"user": {"first_name": "Alice", "age": 30}, "tags": ["admin"]}
The tool generates (Lombok mode):
import java.util.List;
import lombok.Data;
@Data
public class User {
private String firstName;
private int age;
}
@Data
public class RootObject {
private User user;
private List<String> tags;
} FAQ
What does this tool generate?
It generates Java POJO (Plain Old Java Object) classes from JSON. Each nested object becomes its own named public class with private fields and getter/setter methods (or @Data with Lombok).
What annotation modes are supported?
Four modes: None (pure POJO with getters/setters), Jackson (@JsonProperty), Gson (@SerializedName), and Lombok (@Data). Annotations are added only when the JSON key differs from the camelCase field name.
How are JSON types mapped to Java types?
string → String, integer → int, float/double → double, boolean → boolean, null → Object, array → List<T>, nested object → separate class.
When is the List import added?
import java.util.List is automatically included whenever an array field is present in the output.
Is my data sent to a server?
No. The entire conversion runs in your browser. No data leaves your machine.