Unicorn

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