JSON to Java

Generate Java POJO classes from JSON data in your browser.

Infer fields from JSON objects and arrays and generate Java POJO starter code with nested static classes.

How to use

  1. Paste valid JSON.
  2. Generate the result.
  3. Review class names, field types, and unusual keys before copying.

Examples

Object to Java POJO

Input

{"id":1,"name":"demo","enabled":true}

Output

public static class Root {
    private Long id;
    private String name;
    private Boolean enabled;
}
Privacy
May contact server Avoid sensitive data Uploads only when needed

Your JSON and generated Java code are not uploaded.

Frequently asked questions

Yes. Nested objects become static classes and arrays become List types.

Long, Double, and Boolean are easier to adapt when API fields may be nullable.
Next steps

Related tools

After finishing this task, continue with these related tools.