Convert JSON to Dart classes with null-safety and json_serializable support.
Free online JSON to Dart class generator. Paste any JSON object or array and instantly generate null-safe Dart classes with fromJson/toJson constructors. Supports json_serializable annotations, optional field detection, PascalCase class names, camelCase field names, and nested objects. Perfect for Flutter developers building data models from API responses. Runs entirely in your browser — no data is sent to a server.
Keywords: json to dart, json to dart converter, json to dart class, dart model generator, flutter json, dart fromjson, dart serialization, json_serializable dart, flutter data model, json to flutter class, dart null safety json, dart tojson, dart fromJson generator
Tags: json, dart, flutter, converter, class, model, generator
Paste valid JSON into the input area on the left.
Set the root class name (defaults to 'Root') using the option field.
Toggle null-safety and JSON serialization options to match your Dart project requirements.
Click Convert or press ⌘↵ (Mac) / Ctrl+Enter (Windows) to generate Dart model classes.
Copy the generated Dart code with the copy button or download it as a .dart file.
Generates null-safe Dart classes from any JSON object or array.
Supports nested objects — creates separate named classes for each nested structure.
Optional json_serializable annotations (@JsonSerializable, fromJson, toJson) for use with build_runner.
Smart type inference: string, int, double, bool, List, and nullable variants.
Root class name is configurable; nested class names are derived from JSON keys.
Handles JSON arrays of objects by inferring the element type.
Works entirely in your browser — JSON never leaves your device.
Keyboard shortcut ⌘↵ for instant conversion.