Flutter & Dart Tools

JSON to Dart Converter

A sample response is a useful starting point for a Dart model, but it is not a complete schema. This converter creates immutable nullable fields, a constructor, fromJson and toJson methods from a JSON object. Nested objects become separate model classes; homogeneous lists receive inferred element types. Mixed or empty lists remain dynamic because the sample cannot establish a safe type. Read the generated result before using it, especially for optional fields, date strings and values that change type between responses. No build runner or remote service is involved.

Your workspace

Runs locally in your browser

Result

Your input is processed locally in your browser unless explicitly stated otherwise. Inputs are not saved by this tool.

How to use this tool

Paste a representative JSON object, choose a class name, and generate. Review inferred fields before adding the code to your project.

Example

Input

{"name":"Ada","address":{"city":"Pune"}}

Output

A model with nullable name and Address fields, fromJson() and toJson().

What does this tool do?

Dart model classes give JSON data named fields and conversion methods. This generator infers types from a sample object and creates classes for nested objects.

Common mistakes and limitations

Samples do not define a complete API schema. Missing or null fields become nullable; empty or mixed lists use dynamic. Dates remain strings. Review generated names and types against real responses.

Frequently asked questions

Does it support nested lists?

Homogeneous lists of objects and primitives are supported. Mixed and nested lists safely fall back to List<dynamic>.

Related tools