How it works
How to use the JSON ↔ Java
Paste JSON
Any object or array.
Pick a style
Plain POJO with getters/setters, Lombok @Data, or a Java 16+ record. Add a package name if you like.
Map it
Use Jackson ObjectMapper.readValue(json, Root.class) or Gson.
Type mapping
Fields use camelCase names with @JsonProperty when the JSON key differs. Whole numbers become int/long, decimals double, and values that can be null or missing use boxed types (Integer, Boolean). Arrays become List<T>. Nested objects are emitted as nested static classes so the output compiles as a single file. The reverse mode reads fields, records and annotations (Jackson and Gson) to build sample JSON.
Built for developers
Why developers use it
Private by design
Runs 100% in your browser. Nothing you paste is uploaded, logged or stored on a server.
Instant results
Output updates as you type, with precise error locations when something is wrong.
Works offline
Once loaded, the tool keeps working without a connection. Install it as an app if you like.
Free, no sign-up
No accounts, no limits, no watermarks.
FAQ
Frequently asked questions
Records or classes?
Records (Java 16+) are immutable and concise, and Jackson 2.12+ supports them. Use POJOs or Lombok if you need setters or older Java versions.
Does it support java.time types?
Yes — enable "java.time / UUID" to map ISO date-time strings to OffsetDateTime, dates to LocalDate and UUID strings to UUID.
Is my data uploaded anywhere?
No. This tool runs entirely in your browser. Your input never leaves your device, is not logged, and works offline once the page has loaded.
Keep going
Related tools
- JSON ↔ TypeScriptGenerate TypeScript interfaces from JSON (and back)
- JSON Schema GeneratorInfer a JSON Schema from sample JSON
- JSON to PythonGenerate Python classes from JSON
- JSON to GoGenerate Go classes from JSON
- JSON ↔ C#Generate C# classes or records from JSON (and back)
- JSON to RustGenerate Rust classes from JSON
- JSON FormatterFormat, validate and explore JSON
- JSON ValidatorFind and fix JSON syntax errors