# PetitParser for Dart

> Composable, type-safe parser combinators in plain Dart

Source: https://talira.ai/catalog/petitparser-for-dart-53n4kmxv
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / parser generators](https://talira.ai/categories/developer-tools/parser-generators), [languages / dart](https://talira.ai/categories/languages/dart)
- Licence: MIT[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Lukas Renggli](https://talira.ai/orgs/lukas-renggli.md)

PetitParser for Dart builds parsers in plain Dart code instead of regular expressions or external code generators. You assemble small parsers like building blocks, from single characters up to whole grammars for configuration formats or programming languages, and map what they match straight into typed Dart records, syntax trees or domain objects using generics and pattern matching. It has optimized fast paths for character matching and built-in tools to inspect tokens and trace parsing in your IDE.

## Links

- Website: https://petitparser.github.io/
- GitHub: https://github.com/petitparser/dart-petitparser

## Problems it solves

- write a parser in Dart without regular expressions
- parse a configuration format or small language in Flutter
- build a type-safe grammar in Dart without a code generator

## Features

- compose parsers with operators and methods in plain Dart
- type-safe results with Dart records, generics and pattern matching
- optimized character predicates and fast-path parsing
- token inspection and parse tracing for debugging

## Trust

Overall: 0.52 out of 1.
Signals: maintenance 0.85, adoption 0.54, momentum 0.17, community 0.53, backing 0.30, extensibility 0.00.

- last commit 4 days ago
- 38 commits in the last 90 days
- 487 GitHub stars
- 20 contributors
- accepts sponsorship (Github)
- backed by Lukas Renggli

## Alternatives

- [peg](https://talira.ai/catalog/peg-n3v4m78r.md): Packrat parser generator for Go from Parsing Expression Grammars

## Sources

[^1]: https://github.com/petitparser/dart-petitparser/blob/main/README.md (checked 28 Nov 2026)
[^2]: https://github.com/petitparser/dart-petitparser/blob/main/LICENSE (checked 28 Nov 2026)
