JSON to Dart
Paste JSON and instantly get matching Dart model classes with fromJson/toJson factories and nullable-safe fields.
Input JSON
Dart Output
Paste JSON and click Generate
Copied!
Summary
Paste JSON and instantly get matching Dart model classes with fromJson/toJson factories and nullable-safe fields.
How it works
- Paste or type JSON into the input panel, or load a sample.
- Set a root class name (defaults to RootObject).
- Click Generate to parse the JSON and build Dart model classes.
- Nested objects become their own named classes; arrays of objects are scanned across all items to detect optional fields.
- Fields that are missing from some items, or that hold null, become nullable properties.
- Click Copy to copy the Dart code to your clipboard.
Use cases
- Scaffold model classes for a REST API response before wiring up an http or dio call in Flutter.
- Turn a sample config file into a typed Dart settings class.
- Generate a starting model with fromJson/toJson without typing every field by hand.
- Document a third-party API response shape as Dart types.
- Check which fields are optional before writing null-handling logic by hand.
- Speed up adding a new Flutter model from sample JSON during prototyping.
Frequently Asked Questions
Last updated: 2026-07-23 ·
Reviewed by Nham Vu