XML to Dart Converter
Paste XML and generate Dart model classes for Flutter or Dart projects.
Last updated: May 28, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is XML to Dart Converter?
This tool converts an XML sample into a normalized object shape and then generates Dart classes from it. XML attributes can be preserved, repeated elements become lists, nested elements become nested classes, and simple text values can be inferred as numbers or booleans when possible.
How to Use XML to Dart Converter
Paste XML into the input panel.
Set a root class name or let the tool use the XML root element.
Choose whether to include XML attributes and infer scalar values.
Toggle Dart options such as final fields, nullable fields, and fromJson/toJson output.
Copy the generated Dart code.
Common Use Cases
- Creating Flutter model classes from XML API responses.
- Migrating XML feed samples into Dart data models.
- Bootstrapping parser models before adding custom XML handling.
- Documenting XML payloads as typed Dart classes.
Example Input and Output
An XML order with repeated item elements becomes Dart classes with a List<Item> field.
<order id="A100"><item><quantity>2</quantity></item></order>class Order {
final String? id;
final List<Item>? item;
Order({this.id, this.item});
}Privacy
All conversion happens locally in your browser.

