Frequency Asked Questions
Everything you need to know about the converter.
Is my JSON data safe?
Yes. Absolutely. We process everything client-side in your browser. Your data is never sent to our servers. You can even disconnect your internet and the tool will still work.
Why do I get 'Unexpected token' errors?
This usually means your JSON is invalid. Common causes include: trailing commas (not allowed in JSON), using single quotes instead of double quotes, or missing curly braces. Try our 'JSON Validator' tool to find the exact line number.
How to fix UnrecognizedPropertyException in Jackson?
This error occurs when your JSON has fields not present in your POJO. Add @JsonIgnoreProperties(ignoreUnknown = true) to your class, or configure ObjectMapper with .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false).
Does this support Lombok?
Yes. You can toggle 'Use Lombok' in the options. This will replace verbose getters/setters with @Data, @Getter/@Setter, @NoArgsConstructor, and @AllArgsConstructor annotations.
Can I generate Jackson or Gson annotations?
Yes. We support both. By default, we use Jackson (@JsonProperty), but you can switch to Gson (@SerializedName) in the settings.
Can I generate Java Records instead of classes?
Yes! Java 14+ Records are supported. Enable 'Use Records' to generate immutable record types instead of traditional POJO classes with getters/setters.
How do I handle Date fields?
JSON doesn't have a native Date type. We detect ISO-8601 strings and map them to Date or LocalDateTime. If detection fails, we default to String. Use @JsonFormat for custom patterns.
How are enum fields handled?
If JSON contains a fixed set of strings (like status: 'ACTIVE'), our tool detects this pattern and can generate Java enums. Enable 'Generate Enums' in options.
What happens with null values in JSON?
Null values are preserved. For primitive types (int, boolean), use wrapper classes (Integer, Boolean) to avoid defaults. Jackson and Gson handle null -> null mapping automatically.
How to handle primitive vs wrapper types?
We use wrapper types (Integer, Boolean, Double) by default because they can represent null. Primitives (int, boolean) cannot be null and will default to 0/false.
How to map snake_case JSON to camelCase Java?
Our tool automatically converts field names. JSON 'user_name' becomes Java 'userName'. We also add @JsonProperty('user_name') annotation to preserve the mapping.
What is better: IntelliJ plugin or online converter?
IntelliJ plugins like RoboPOJO require installation and IDE restarts. Online converters like ours work instantly, support more options (Lombok, Records), and don't require any setup.
What is the difference between Jackson and Gson?
Jackson (@JsonProperty) is faster and more feature-rich, used by Spring Boot. Gson (@SerializedName) is simpler and lighter, popular on Android. Both work great.
Should I use Moshi or Gson for Android?
Use Moshi. It's built for modern Android, handles Kotlin null-safety correctly, and is smaller. Gson can accidentally set non-null fields to null via unsafe reflection.
Can I use this for Kotlin?
Yes! Enable 'Kotlin Data Classes' to generate idiomatic Kotlin code with val properties. We support both Java and Kotlin output.
How to use generated POJO with Spring Boot?
Just use @RequestBody in your controller: public ResponseEntity<User> create(@RequestBody User user). Spring Boot auto-converts JSON using the Jackson library.
How to use generated POJO with Retrofit?
Add MoshiConverterFactory or GsonConverterFactory to Retrofit.Builder(). Retrofit automatically deserializes responses into your POJO classes.
How to serialize POJO back to JSON?
Use ObjectMapper: String json = mapper.writeValueAsString(pojo); for Jackson, or gson.toJson(pojo); for Gson. Both convert your object to a JSON string.
How to parse JSON with unknown/dynamic fields?
Use Map<String, Object> for dynamic objects, or JsonNode (Jackson) / JsonObject (Gson) for tree-based parsing. Our tool handles known fields only.
How to handle circular references?
Use @JsonManagedReference on the parent and @JsonBackReference on the child to break the loop. This is common with JPA/Hibernate bidirectional relationships.
How does the tool handle nested JSON objects?
Nested objects like {address: {city, zip}} generate separate classes. Enable 'Use Inner Classes' to nest them inside the parent class, or 'Separate Files' for standalone classes.
Is this tool free?
Yes, Json2POJO is 100% free for both personal and commercial use. No signup required. We are supported by community donations.
Still have questions?
Can't find the answer you're looking for? Please chat to our friendly team.
Get in touch