JSON to Java

Convert JSON to Java POJO classes online. Private fields with getters and setters, Jackson annotations for non-trivial keys.

Generated code will appear here...

Everything runs locally in your browser. Your JSON is never uploaded or stored.

What is a JSON to Java converter?

A JSON to Java converter turns JSON samples into POJO classes — private fields, getters and setters, and Jackson annotations where keys need them. Perfect for DTOs, API models, and test fixtures. All processing happens in your browser.

How to generate POJOs from JSON

Paste a JSON object, rename the root class if you like, and copy the generated classes. Nested objects are emitted as separate classes in the same file.

Fields, getters, and setters

Every property becomes a private field with a public getter and setter following standard bean conventions, so the classes work with Jackson, Gson, and most ORMs out of the box.

Arrays, nesting, and nulls

JSON arrays become List<T> and nested objects become classes named after their key, e.g. address inside Root becomes RootAddress. Fields that can be null or absent use boxed wrappers (Integer, Double, Boolean) instead of primitives.

Frequently Asked Questions

How do I generate Java classes from JSON?+
Paste your JSON and each object becomes a Java class with private fields plus public getters and setters. Nested objects become their own classes and arrays become List<T>.
Which types are used?+
Whole numbers map to Integer, decimals to Double, booleans to Boolean, and strings to String. Boxed wrappers are used whenever a field can be missing or null, so nulls deserialize safely.
Why do some fields have @JsonProperty?+
Keys that are not valid Java identifiers or that do not map one-to-one to a camelCase field (e.g. user_name) get a Jackson @JsonProperty annotation so deserialization keeps working unchanged.
Is my JSON stored anywhere?+
No. Everything is generated locally in your browser and nothing is uploaded or logged.

Related Tools

JSON to Java — free online json to java, json to pojo, java class from json, json to pojo generator, json to java class online, generate java pojo from json, json to java bean, java pojo converter, json to dto java, jackson pojo generator. No signup required. Works in your browser.