JSON to Dart Class Generator
Last updated: 2026-09-17
Paste a JSON object and get a Dart model class with named constructor parameters, a fromJson factory, and a toJson method. Null safety is enabled by default — nullable fields (null values in the JSON) get the ? suffix. Nested objects become separate Dart classes. Everything runs in your browser.
Dart naming conventions
The converter preserves JSON key names as-is in field names and fromJson/toJson. If your JSON uses snake_case keys, the Dart fields will also be snake_case. You may want to rename them to camelCase and add @JsonKey annotations for json_serializable.
Int vs double
JSON numbers without decimal points are typed as int. If a field might contain both integers and floats (e.g. “score”: 95 vs “score”: 95.5), you should manually change the type to num or double.