Youtilities

JSON to Dart Class

Generate null-safe Dart classes with fromJson and toJson from any JSON. Made for Flutter.

Runs in your browser. Nothing is uploaded.

Input

Waiting for JSON

Dart
Dart types appear here.

What this does

Paste JSON and get null-safe Dart classes with fromJson and toJson, ready for Flutter. Nested objects become their own classes; arrays of objects are merged into one class.

Null safety

A key that is missing from some items, or sometimes null, becomes a nullable field (String?) and is optional in the constructor; everything else is required. Whole numbers are int, decimals double, unknown values dynamic.

Names

Fields are camelCase; fromJson and toJson use the original keys, so first-name reads and writes correctly as firstName. Two objects with the same shape share one class.

All