JSON to Java POJO
Convert JSON to a Java POJO online with private fields, getters and setters, Jackson @JsonProperty and nested classes — free and 100% in your browser.
What is the JSON to Java POJO?
The ByteTools JSON to Java generator turns a JSON sample into a plain old Java object. It infers String, Integer, Long, Double, Boolean and List types, converts keys to camelCase fields, and writes the getters and setters for you.
- Private fields with public getters and setters
- Optional Jackson @JsonProperty for exact key mapping
- Lombok @Data mode for projects that use Lombok
- Nested objects become static inner classes in one file
- Infers Integer, Long, Double, Boolean, String and List types
- 100% private — JSON never leaves your browser
How to use the JSON to Java POJO
- 1
Paste a representative JSON sample, or drop a .json file to load it.
- 2
Set the root class name for the generated POJO.
- 3
Choose whether to add Jackson @JsonProperty annotations or use Lombok @Data.
- 4
Click Generate POJO, then copy the code or download it as a .java file.
About the JSON to Java POJO
The ByteTools JSON to Java generator turns a JSON sample into a plain old Java object. It infers String, Integer, Long, Double, Boolean and List types, converts keys to camelCase fields, and writes the getters and setters for you. Nested objects become static inner classes, so the whole model compiles as a single .java file.
Optional Jackson @JsonProperty annotations preserve the original key names for serialisation, and a Lombok @Data mode drops the accessors when your project already uses Lombok. It is built for Java developers mapping REST responses, config files and message payloads.
Inference runs 100% locally in your browser with JavaScript — nothing is compiled or uploaded. Your JSON is never stored, so internal APIs and confidential payloads stay on your machine.
Frequently asked questions
How do I generate a Java POJO from JSON?
Paste your JSON, set a root class name and click Generate POJO. Each object becomes a class with private fields plus getters and setters, nested objects become static inner classes, and the output is a single compilable .java file.
Does it add Jackson annotations?
Yes, when the annotation option is on each field gets a @JsonProperty carrying its exact JSON key. That keeps deserialisation correct even after keys like first_name are converted to the camelCase field firstName.
Why are nested objects inner classes instead of separate files?
Java allows only one public top-level class per file, so emitting nested types as public static inner classes keeps the output valid and copy-pasteable. Move them into their own files later if you prefer.
How are numbers mapped to Java types?
Whole numbers become Integer, or Long when a value is too large for a 32-bit int, and numbers with a decimal point become Double. Wrapper types are used rather than primitives so a JSON null can be represented.
Is my JSON sent to a server?
No. The generator runs entirely in your browser with JavaScript. Nothing is uploaded, logged or stored, so it is safe for confidential payloads and internal schemas.
Related tools
JSON to TypeScript
Generate TypeScript interfaces from a JSON sample online. Infers types recursively, merges array shapes and marks optional keys — 100% in your browser.
JSON to Python Dataclass
Convert JSON to Python dataclasses online. Infers str, int, float, bool, List and Optional types, builds nested classes and snake_case fields in your browser.
JSON to Go Struct
Convert JSON to Go structs online with exported fields and json tags. Generates nested structs and slice types from a sample — free and 100% in-browser.
JSON Schema Generator
Generate a JSON Schema (draft-07 or 2020-12) from a sample JSON document. Infers types, required keys and array items for validation — 100% in your browser.
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.