JSON to Model Generator
Paste a JSON sample and get matching classes or types for your language. The code is generated in your browser as you type.
- Runs on your device
- No sign-up
- Free, no watermark
How to use the JSON to Model Generator
- 01Paste a JSON sample into the Input pane, or press Sample.
- 02Pick the target language and set the root type name.
- 03Open Options to choose types only, optional properties or language-specific settings.
- 04Copy the generated code, or download it as a source file. Java comes as a ZIP with one .java file per class.
Good to know
Runs on your device
Your JSON is processed in the browser with quicktype-core. Nothing is sent to a server.
10 languages
TypeScript, C#, Go, Java, Python, Swift, Rust, C++, Kotlin and Dart.
Updates as you type
The code is regenerated a moment after you stop typing, or change the language or options.
Options per language
Types only, all-optional properties, and extra Dart and TypeScript settings.
Frequently asked questions
Is my JSON sent anywhere?
No. quicktype-core runs in your browser, so API responses with private data stay on your device.
How are types worked out?
From the sample you paste. In an array of objects, the items are merged into one type: a property missing from some items becomes optional, and one that is sometimes null becomes nullable. Include examples of every shape you expect.
What does "Types only" do?
It leaves out the serialization helpers, such as converters and JSON encode and decode functions, and keeps just the type definitions. For C#, it keeps the JSON attributes but drops the helper code.
Why is the output for my language empty or an error?
Usually the input isn't valid JSON: the status bar shows the parser message, and the last code that worked stays on screen marked as out of date. If the JSON is valid, quicktype's own error is shown instead.
Why does Java download as a ZIP?
Java needs each public class in its own file named after it, so the code is split into Welcome.java, one file per nested type, and a Converter.java helper unless Types only is on. Pick a file above the output to view or copy it.
Can I use the code in my project?
Yes. The generated code is yours to use. Check it against your real data, because types are inferred from the sample only.