Paste a JSON sample to draft Java classes: one file per class, private fields with a getter and a setter, and nested objects and arrays as their own model classes. Names Java cannot use are renamed and annotated with Jackson @JsonProperty, and the sources download as a ZIP that keeps the package folders.
Runs locally in your browserPaste a JSON sample — an API response, a configuration file or a webhook body — and this page writes the Java classes that match it: one class per file, with private fields and a getter and a setter for each. Set the root class name and the package, press Generate JavaBean, then download every file as one ZIP or take the code out of the page. The conversion runs in your browser, the payload is never uploaded, and the page keeps working offline once it has loaded.
Two parts of the output are deliberate rather than incidental. Every field name is a legal Java identifier, and a property that had to be renamed keeps its original JSON name in a Jackson @JsonProperty annotation, so the generated class still maps the payload it came from. Everything else — types, class names, nesting — is inferred from the sample you pasted, which is why the result is a draft to review rather than a finished model.
Text becomes String, and true or false becomes boolean. Integers that fit in 32 bits become int; larger whole numbers become long, and whole numbers outside the range JavaScript represents exactly become BigDecimal so that nothing is rounded behind your back. Numbers with a decimal point become double, and null becomes String, because a lone null carries no type information.
A string that looks like a date becomes java.util.Date. 2024-05-06, 2024/05/06, 12/31/2024, May 6, 2024 and ISO 8601 timestamps with an optional timezone all qualify. Digits on their own do not: 20240506, 2024 and "1-2" stay String, so an id, a year or a version number is not turned into a date by accident.
A property name that is already a legal Java identifier is kept as written, capitalisation included. Anything else is folded into camelCase by splitting on the characters Java does not accept: user_name becomes userName, a.b becomes aB, user name becomes userName. A name that is a Java keyword or starts with a digit gets a leading underscore, so {"class": 1} produces the field _class.
Class names follow the same rules and start with a capital letter. Two extra safeguards apply. A class may not be named like a type the file itself uses, so a property called list produces ListModel instead of shadowing java.util.List; and two objects may not claim the same class name, so the second is qualified with its parent — wrap.data becomes WrapData while the outer data stays Data. Inside one object, user_name and userName collide and the second field becomes userName2. The annotation is imported from com.fasterxml.jackson.annotation.JsonProperty, the Jackson 2 package.
A nested object becomes a class of its own, named after the property that holds it, and the field points at that class. Arrays become List<...>: an array of strings is List<String>, an array of objects is List<Users> plus the class Users, and a nested array keeps its depth, so [[1,2]] is List<List<Integer>>. Type arguments are always boxed — List<Integer> and never List<int> — because Java does not allow a primitive there.
Inside an array of objects every element is read, not only the first: a field that appears in some elements is still added, arrays inside those objects are combined, and a property that holds different types in different elements becomes Object. An empty array carries no element type at all, so its element is typed String as a placeholder. A top-level array is treated the same way — the root class is built from the properties of all its elements.
Each file holds a package line, the imports that file actually uses, a short Javadoc header with the generation time and this page's URL, one public class, and private fields each with a getter and a setter. There is no Lombok, no builder and no equals or hashCode: the output is a plain JavaBean that needs the JDK and, when a field had to be renamed, the Jackson annotations on your classpath.
Nothing is compiled or checked against your project here, and the types come from a single sample. Optional fields, nested nulls or a value that changes type between calls cannot show up in that sample, and a number that is an int today becomes a primitive field you may later have to box. A few hundred kilobytes convert in well under a second in the browser, so a large response is fine to paste, but treat the sample as a snapshot rather than a schema.