Stage 01 · Write · Researched comparison
Best Dart JSON Serialization Libraries in 2026
json_serializable is the first pick for most Dart and Flutter teams because it builds on dart:convert and generates fromJson and toJson code through build_runner. Pick freezed when you also want immutable models, copyWith, and sealed unions. Pick dart_mappable if you want similar features with a different code-generation approach. built_value suits projects already using its value-type system, and dart:convert alone works for small or irregular payloads.
By Shihab Mia
Published 27 Nov 2026 · 6 tools compared
We run no ads and no affiliate links at launch. The order of a list follows our published method. See how we score.
Prices are the starting prices vendors list publicly. Plans change, so confirm the current price on the vendor page before you buy.
Key takeaways
- json_serializable, freezed, built_value, and dart_mappable are all free and open source.
- json_serializable and built_value come from Google-owned repositories; freezed and dart_mappable are community projects.
- All four code generators run locally through build_runner, so your model data stays on your machine.
- quicktype generates model code from sample JSON on its website, so avoid pasting production payloads with secrets.
Who each pick is for
- Most Dart and Flutter apps that want generated JSON codejson_serializable
- Immutable models with copyWith, equality, and sealed unionsfreezed
- Projects already using built_value value types and serializersbuilt_value
- Generated mapping with hooks, unions, and minimal boilerplatedart_mappable
- Small payloads and manual control without code generationdart:convert (jsonDecode and jsonEncode)
- Generating Dart model code from sample JSONquicktype
Comparison
| Tool | Best for | Standout feature | Listed starting price | Free plan or trial |
|---|---|---|---|---|
| 1json_serializable | Most Dart and Flutter apps that want generated JSON code | Builds on dart:convert | Free (open source) | Free plan |
| 2freezed | Immutable models with copyWith, equality, and sealed unions | Generates immutable classes, copyWith, equality, and union types | Free (open source) | Free plan |
| 3built_value | Projects already using built_value value types and serializers | Mature value-type system with serializers | Free (open source) | Free plan |
| 4dart_mappable | Generated mapping with hooks, unions, and minimal boilerplate | Single generator covers mapping, copyWith, equality, and unions | Free (open source) | Free plan |
| 5dart:convert (jsonDecode and jsonEncode) | Small payloads and manual control without code generation | Built into the Dart SDK | Free | Free plan |
| 6quicktype | Generating Dart model code from sample JSON | Generates Dart classes from JSON samples | Free | Free plan |
How we picked
We picked libraries that actually perform JSON serialization or model generation for Dart and Flutter, then compared them on fit for common tasks, platform support, licence and price, whether generation runs locally, and main limits such as build steps or boilerplate. Sources are official project repositories, package documentation, and vendor pages. Prices and free-plan details can change, so confirm on the vendor site before you commit.
The tools, one by one
json_serializable
Best for most Dart and Flutter apps that want generated JSON code

What it is and where it fits
json_serializable generates fromJson and toJson methods from annotated classes. You add a part directive, run build_runner, and the generated file handles field mapping, renamed keys, defaults, and nested objects. It sits on top of dart:convert, so encoding behavior matches the core library.
It runs anywhere Dart runs, including Flutter on mobile, desktop, and web, and it is published from the google/json_serializable.dart repository. The package is free and open source. The main cost is build tooling: you maintain generated files and rerun the builder after model changes. Teams that dislike code generation or have very small payloads may prefer writing manual converters.
Standout: Builds on dart:convert
Free (open source), as listed by the vendor (json_serializable website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Builds on dart:convert
- works with build_runner and analyzer tooling
Drawbacks
- Requires generated part files
- nested and custom types need extra configuration
Skip it if this limit matters to you: requires generated part files.
Verdict. A sensible pick for most Dart and Flutter apps that want generated JSON code.
Alternatives in this guide: freezed, built_value, dart_mappable
freezed
Best for immutable models with copyWith, equality, and sealed unions

What it is and where it fits
freezed is a code generator for immutable data classes. For JSON work it is usually combined with json_serializable: freezed defines the class shape, unions, and copyWith, while json_serializable handles the fromJson and toJson methods. This combination is common in Flutter apps that model API responses as sealed unions or need value equality.
It runs through build_runner like other Dart generators and is free and open source from the rrousselGit/freezed repository. The tradeoff is build complexity: two generators, more generated output, and a learning curve for union syntax. If you only need JSON mapping without immutability features, plain json_serializable is simpler.
Standout: Generates immutable classes, copyWith, equality, and union types
Free (open source), as listed by the vendor (freezed website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Generates immutable classes, copyWith, equality, and union types
- pairs with json_serializable for JSON
Drawbacks
- Adds another generator to the build
- generated code can be large
Skip it if this limit matters to you: adds another generator to the build.
Verdict. A sensible pick for immutable models with copyWith, equality, and sealed unions.
Alternatives in this guide: json_serializable, built_value, dart_mappable
built_value
Best for projects already using built_value value types and serializers

What it is and where it fits
built_value provides immutable value types plus a serializer framework, and its JSON support comes through built_value_json_serializers. You define abstract classes, generate implementations, and register serializers for the types you use. It handles enums, nested objects, and polymorphic types through explicit serializer registration.
It is maintained in the google/built_value.dart repository and is free and open source. It runs on the Dart VM and in Flutter. The main drawback is setup cost: more files, more registration, and a steeper learning curve than annotation-only generators. Teams without an existing built_value codebase usually get faster results from json_serializable or freezed.
Standout: Mature value-type system with serializers
Free (open source), as listed by the vendor (built_value website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Mature value-type system with serializers
- strong support for enums and nested types
Drawbacks
- More boilerplate and setup than json_serializable
- smaller ecosystem of examples
Skip it if this limit matters to you: more boilerplate and setup than json_serializable.
Verdict. A sensible pick for projects already using built_value value types and serializers.
Alternatives in this guide: json_serializable, freezed, dart_mappable
dart_mappable
Best for generated mapping with hooks, unions, and minimal boilerplate

What it is and where it fits
dart_mappable is a code generator that handles JSON mapping, copyWith, equality, and union types in one package. You annotate classes and run build_runner. It supports custom type hooks, polymorphic decoding, and configuration for naming and null handling, so it can replace a json_serializable plus freezed setup with one generator.
It is published from the schultek/dart_mappable repository and is free and open source. It runs wherever Dart runs. The tradeoff is ecosystem size: fewer tutorials and Stack Overflow answers than the more established options, which matters when onboarding a team. It is a reasonable choice for new projects that want one generator instead of two.
Standout: Single generator covers mapping, copyWith, equality, and unions
Free (open source), as listed by the vendor (dart_mappable website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Single generator covers mapping, copyWith, equality, and unions
- supports custom hooks and polymorphism
Drawbacks
- Smaller community than json_serializable
- fewer third-party examples
Skip it if this limit matters to you: smaller community than json_serializable.
Verdict. A sensible pick for generated mapping with hooks, unions, and minimal boilerplate.
Alternatives in this guide: json_serializable, freezed, built_value
dart:convert (jsonDecode and jsonEncode)
Best for small payloads and manual control without code generation

What it is and where it fits
dart:convert is the core Dart library that provides jsonDecode and jsonEncode. It turns JSON strings into maps, lists, and primitives, and back again. There is no code generation, no build_runner step, and no package dependency. For one-off parsing, configuration files, or payloads with irregular shapes, it is often the fastest path.
It ships with the Dart SDK and works on every Dart platform, including Flutter web and mobile. The cost is manual work: you write factory constructors, cast map values, and handle missing or null fields yourself. As models grow, that code becomes repetitive and error-prone, which is when generated serializers pay off. Use it for small or dynamic data, not large model sets.
Standout: Built into the Dart SDK
Free, as listed by the vendor (dart:convert (jsonDecode and jsonEncode) website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Built into the Dart SDK
- no dependencies or build step
Drawbacks
- No generated models
- manual casting and null handling for every field
Skip it if this limit matters to you: no generated models.
Verdict. A sensible pick for small payloads and manual control without code generation.
Alternatives in this guide: json_serializable, freezed, built_value
quicktype
Best for generating Dart model code from sample JSON

What it is and where it fits
quicktype is a code generator that takes sample JSON and produces model classes, including Dart with fromJson and toJson methods. It is useful for bootstrapping models from an API response or a schema before you settle on a serialization library, and it supports many output languages beyond Dart.
It runs as a web app at quicktype.io and also as a command-line tool. The web app is convenient but means pasting JSON into a third-party page. Do not paste production payloads that contain tokens, personal data, or secrets; use sanitized samples or the local CLI instead. Generated code is a starting point and usually needs cleanup, null handling, and integration with your chosen library.
Standout: Generates Dart classes from JSON samples
Free, as listed by the vendor (quicktype website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Generates Dart classes from JSON samples
- supports many output languages
Drawbacks
- Web-based generation
- generated code still needs review and integration
Skip it if this limit matters to you: web-based generation.
Verdict. A sensible pick for generating Dart model code from sample JSON.
Alternatives in this guide: json_serializable, freezed, built_value
Who should use what
A Flutter team with many API models should start with json_serializable and add freezed if it needs immutable models or sealed unions. A new project that wants one generator for mapping, equality, and unions can try dart_mappable. A codebase already built on built_value should stay with built_value serializers rather than migrate. A developer parsing a small config file or an irregular payload can use dart:convert with no dependencies, and anyone bootstrapping models from a sample response can use quicktype, then move the result into json_serializable or freezed.
Questions to settle before you buy
What to check before you buy
- Confirm the package supports your Dart and Flutter SDK versions and is still maintained.
- Check whether you are willing to run build_runner and commit generated files.
- Decide if you need immutability, copyWith, and unions, or only JSON mapping.
- Test how the library handles nulls, missing keys, enums, and nested lists.
- For web-based generators, sanitize sample JSON and avoid pasting secrets or production data.
FAQ
Is json_serializable part of the Dart SDK?
No. json_serializable is a separate open-source package from Google that generates code on top of dart:convert. The SDK itself provides jsonDecode and jsonEncode in dart:convert, but it does not generate model classes.
Do I need freezed if I use json_serializable?
No. freezed adds immutable classes, copyWith, equality, and unions. Many teams combine the two, but json_serializable works alone if you only need fromJson and toJson methods.
Can I use these libraries without code generation?
Only dart:convert avoids code generation entirely. json_serializable, freezed, built_value, and dart_mappable all rely on build_runner to produce code, which means an extra build step in your workflow.
Is quicktype safe for production JSON?
Be careful. The quicktype web app processes JSON you paste into a third-party page. Use sanitized samples or the local command-line tool, and never paste tokens, credentials, or personal data.
Are these libraries free?
Yes. json_serializable, freezed, built_value, dart_mappable, and quicktype are free and open source, and dart:convert ships with the Dart SDK. Check each repository for its current licence terms.
Sources we checked
Method: how we score · editorial policy.
Change log. First published 27 Nov 2026.