JSON to Java Class
Paste a JSON sample to get a Java class: each field takes the widest type seen in the sample, nested objects become static inner classes, arrays become List of that type, and an array of objects is merged into one class covering every field seen. Set the package and class name, then copy or download the file — plain getters and setters only, no Lombok required.
How to use
Generate a plain Java POJO with nested types from a JSON sample. Your data is processed only inside this browser tab.
FAQ
What type does a number become?
Integers become long, fractional values become double, and a field seen as both becomes double, so no sample value is silently truncated.
Do I still have to review the output?
Yes. Field naming, nullability and whether money should be BigDecimal are judgement calls a generator cannot make.
Related tools
JSON Formatter
Beautify, minify and validate JSON right in your browser. No uploads, nothing leaves your device.
PopularRegex Tester
Live matches, capture groups and a replace preview for JavaScript regex.
PopularJSON to CSV
Flatten a JSON array into CSV, nested keys becoming columns.
JSON ⇄ XML Converter
Convert between JSON and XML in both directions.
JWT Decoder
Read a JSON Web Token's header and claims — signature not verified.
JSON Diff
Compare two JSON documents by path, with added, missing and changed values.