About JSON to Java POJO Class
This tool reads a JSON object and generates matching Java POJO (Plain Old Java Object) classes — with private fields, standard getters/setters, and optional Jackson @JsonProperty annotations for fields that don't map cleanly to Java's camelCase naming convention. Nested objects become their own separate classes, and arrays are typed as List<T>. Paste a sample API response and get backend- or Android-ready model classes in seconds. All processing happens locally in your browser; your data is never uploaded to a server.
How Type Inference Works (and Its Limits)
This tool infers Java types purely from the JSON values you provide. Whole numbers become int and decimals become double when a field is always present in your sample; when a field is missing from some array elements, it switches to the wrapper type (Integer, Double, Boolean) instead of the primitive, since Java primitives can't represent a missing/null value. Since Java has no built-in union type, a field that holds different types across array items (e.g. sometimes a string, sometimes a number) falls back to Object. JSON keys are converted to Java's camelCase convention (e.g. first_name becomes firstName); when the original JSON key differs from the generated field name, a Jackson @JsonProperty annotation preserves the original key for correct serialization/deserialization. As with any code generated from a single example, it's worth reviewing the result against your actual API contract before using it in production.
Send Feedback
For any questions, bug reports, or feature requests, please use the form below to send us a message.