MewTools

DeveloperAdded

JSON to Java Class

Generate Java POJOs with private fields and getters from a JSON sample. Wrapper types keep the classes null-safe for Jackson, Gson or Moshi.

Runs locallyNo uploadGetters includedFree, no account

Generate Java classes

211 / 232

Result

Waiting

Run the tool and the result appears here. Copy it or download it — nothing leaves this tab.

Privacy

Local by design

The sample is parsed in this tab. Nothing is uploaded, so payloads with real customer data stay on your machine.

How to use it

01

Paste a JSON object or array with one representative element.

02

Set the root class name; nested objects get the name of their key.

03

Copy the classes. Each public class belongs in its own .java file.

When to use it

Android and Spring clients

Write the DTO once and let Jackson map the response, instead of hand-typing fields from the docs.

Legacy integrations

A partner sends an undocumented payload; generate the model and let the compiler find the gaps.

Code review

Paste the generated classes into the ticket so the field names are agreed before anyone codes.

Questions

Why Integer and Double instead of int and double?

A missing or null JSON field would break a primitive. Wrapper types can be null, which is what JSON actually allows.

Are Lombok or records used?

No. The output is plain Java 8 with explicit getters and setters, so it compiles in any project without adding a dependency or bumping the language level.

What about date fields?

Strings stay String. JSON has no date type, so pick LocalDate, Instant or OffsetDateTime in your own mapping rather than trusting a guess.

↑↓ to move↵ to openEsc to close