JSON to Dart.
Generate null-safe Dart model classes from any JSON document — with fromJson and toJson already written, and no build step to run.
Local · No upload · No size limit on opening · Apache-2.0
Pandia turns a JSON document into plain Dart classes with null safety applied. Every class gets a const constructor, final fields, a fromJson factory and a toJson method — so the serialization code you would normally generate with build_runner is already in the output. Nested objects and arrays become their own classes and List<T>.
Example
Input JSON:
{
"id": 42,
"name": "Ada",
"active": true,
"tags": ["admin", "early"]
} Dart output:
class Root {
const Root({
required this.active,
required this.id,
required this.name,
required this.tags,
});
factory Root.fromJson(Map<String, dynamic> json) => Root(
active: json['active'] as bool,
id: json['id'] as int,
name: json['name'] as String,
tags: List<String>.from(json['tags'] as List<dynamic>),
);
final bool active;
final int id;
final String name;
final List<String> tags;
Map<String, dynamic> toJson() => {
'active': active,
'id': id,
'name': name,
'tags': tags,
};
} What you get
- Null-safe classes with
finalfields and aconstconstructor. fromJsonandtoJsonincluded — nojson_serializable, nobuild_runner.- Optional fields become nullable (
?) and drop out of the required parameters. - Field names become
lowerCamelCasewhile the original JSON keys stay in the maps.
It’s the same engine behind Pandia’s type generation — opinionated, deterministic, and built to run on files far too large for an online converter.
Frequently asked questions
How do I generate Dart classes from JSON?
Open the Types panel in Pandia, choose Dart, and copy the generated classes into your Flutter or Dart project.
Do I need json_serializable or build_runner?
No. Each class carries its own fromJson factory and toJson method, so there is no code generation step and no extra package to add.
Is the output null-safe?
Yes. Fields missing from some objects become nullable and are left out of the required constructor parameters, so the classes compile under Dart null safety.
Stop fighting your JSON.
Download the native app, open your biggest file, and get to work. Free, offline, and open source.