Parsing libraries, parser generators, and format parsers, organized by technique and tagged by language.
Every entry links to an actively maintained project. Entries that go quiet for more than two years are moved to the graveyard rather than deleted, so you can still find them but know what you're getting into. A monthly check flags candidates automatically.
- Parser Combinators
- PEG Parsers and Generators
- LL and Earley Parsers
- LR / LALR / GLR Generators
- Incremental and Error-Tolerant Parsers
- Lexers and Tokenizers
- Format Parsers
- Language Parsers
- Learning Resources
Build parsers by composing small functions. Best for hand-tuned grammars, good error messages, and when you want to stay in your host language.
- nom
Rust- Zero-copy, byte-oriented combinators. The default choice for binary and text protocols. - winnow
Rust- A fork of nom focused on ergonomics and debuggability. - chumsky
Rust- Combinators with first-class error recovery and pretty diagnostics via ariadne. Development moved from GitHub to Codeberg in 2026. - combine
Rust- Zero-copy combinators with support for partial (streaming) parsing. - lexy
C++- Compile-time combinators with a grammar DSL and detailed error reporting. - Boost.Spirit
C++- Long-lived combinator framework (X3 and Qi) where the grammar is written as C++ expression templates. - parsec
Haskell- The original monadic parser combinator library. - megaparsec
Haskell- Modern successor to parsec with better error messages and performance. - attoparsec
Haskell- Fast combinators for ByteString and Text with incremental input. - parsy
Python- Small, readable combinator library with a generator-based syntax. - pyparsing
Python- Long-lived combinator library with a large ecosystem of examples. - parjs
JavaScriptTypeScript- Combinators with detailed failure reasons and soft/hard failure semantics. - jparsec
Java- Recursive-descent combinators in the Parsec style. - Pidgin
C#- Lightweight, fast combinators with LINQ syntax. - fastparse
Scala- Combinators with macro-generated fast parsers. - cats-parse
Scala- Typelevel combinators that track in the types whether a parser consumes input. - better-parse
Kotlin- Multiplatform combinators with a grammar DSL and a built-in tokenizer. - swift-parsing
Swift- Combinators from Point-Free that can also print (invert) what they parse. - petitparser
Dart- Dynamic combinators that build PEG-style grammars at runtime; also ported to Java, Smalltalk and others. - mpc
C- Micro parser combinators for C with a grammar mini-language. - mecha
Zig- Parser combinator library for Zig built on comptime. - NimbleParsec
Elixir- Compile-time combinators that generate efficient binary pattern matches. - participle
Go- Builds parsers from struct tags; closer to a generator than classic combinators.
Parsing Expression Grammars: ordered choice, unlimited lookahead, no ambiguity. Great for DSLs and config languages. Earley and LL toolkits that are sometimes lumped in with PEG (Lark, nearley, Chevrotain) are in the next section.
- pest
Rust- PEG grammar in a separate file, derive macro generates the parser. - rust-peg
Rust- Grammar written inline in Rust via a macro. - TatSu
Python- EBNF in, memoizing Packrat PEG parser out. - Arpeggio
Python- PEG parser interpreter with Packrat memoization; the engine under textX. - parsimonious
Python- Pure-Python Packrat PEG parser with a concise grammar syntax. - pegen
Python- The PEG parser generator behind CPython's own parser, available as a standalone package. - textX
Python- Meta-language for building DSLs with automatic model construction. - Peggy
JavaScript- Maintained successor to PEG.js. - Ohm
JavaScript- PEG with a separate semantics layer and an interactive grammar editor. - pigeon
Go- PEG grammar to Go code generator. - peg
Go- Generates Go Packrat parsers from PEG grammars. - LPeg
Lua- PEGs as first-class pattern values; extremely fast. - cpp-peglib
C++- Single-header PEG library with AST generation. - PEGTL
C++- Template-based PEG where the grammar is C++ types. - packcc
C- PEG parser generator producing C code, with Packrat memoization and left-recursion support. - Treetop
Ruby- PEG grammars compiled to Ruby parsers; the long-standing Ruby choice.
Top-down parsing. LL(k) and ALL(*) generators produce predictable recursive-descent code; Earley parsers accept any context-free grammar, ambiguous ones included, at some cost in speed.
- ANTLR
JavaPythonJavaScriptC#C++Go- ALL(*) parser generator with runtimes for ten languages and the largest grammar collection in existence. - grammars-v4
Grammars- Community collection of several hundred ANTLR grammars, from SQL dialects to COBOL. - JavaCC
Java- Mature LL(k) generator with a long record in Java tooling; also emits C++ and C# parsers. - Chevrotain
JavaScriptTypeScript- Fast LL(k) parser-building toolkit; no code generation step. - Langium
TypeScript- DSL framework on top of Chevrotain that generates a parser, a language server and VS Code support from one grammar. - Xtext
Java- Eclipse framework for DSLs: grammar in, ANTLR-based parser plus editor tooling out. - Lark
Python- Earley and LALR(1) engines behind an EBNF grammar; handles ambiguous grammars. - nearley
JavaScript- Earley parser toolkit for ambiguous grammars. - Pyleri
Python- Grammar defined in Python that can export the parser to JavaScript, C, Go and Java.
Classic bottom-up, table-driven parsing. Deterministic, fast, and well understood; GLR handles ambiguity.
- Bison
CC++Java- GNU LALR(1)/GLR generator; the yacc successor. - byacc
C- Berkeley Yacc, maintained by Thomas Dickey; a lean, portable yacc without GNU extensions. - Lemon
C- LALR(1) generator maintained as part of SQLite; thread-safe and re-entrant. - LALRPOP
Rust- LR(1) generator with readable grammars and good error messages. - grmtools
Rust- Yacc-compatible LR generator with automatic error recovery, plus a lex-compatible lexer. - Menhir
OCaml- LR(1) generator with incremental API and error-message tooling. - Happy
Haskell- LALR(1) generator used by GHC's own parser. - goyacc
Go- The yacc port for Go, maintained in the Go tools repository. - yecc
Erlang- LALR(1) generator from Erlang's parsetools, usually paired with the leex lexer generator; also used from Elixir.
Designed for editors and tooling, where input changes constantly and is often invalid.
- tree-sitter
C- Incremental GLR parser generator with hundreds of community grammars and bindings for most languages. The standard for editor syntax trees. - Lezer
JavaScript- Incremental LR parser system built for CodeMirror 6, with GLR fallback for ambiguity. - rowan
Rust- Lossless syntax tree library (red/green trees) from rust-analyzer. - Roslyn
C#- The .NET compiler platform; full-fidelity, error-tolerant syntax trees for C# and VB.
- logos
Rust- Derive-based lexer generator that compiles to a tight state machine. - re2c
CC++GoRust- Lexer generator producing fast direct-coded scanners. - Flex
C- The classic fast lexical analyzer generator. - RE/flex
C++- Flex-compatible generator for C++ with Unicode support and indentation anchors. - Ragel
CC++GoJava- State machine compiler for protocol and lexer code; version 7 is developed at colm.net. - JFlex
Java- Lexer generator for Java, used in IntelliJ language plugins and alongside CUP. - moo
JavaScript- Optimized tokenizer for use with nearley or standalone. - Alex
Haskell- Lexer generator, companion to Happy. - sedlex
OCaml- Unicode-aware lexer generator implemented as a PPX extension.
- simdjson
C++- Parses gigabytes per second using SIMD; bindings for Python, Rust, Go, Node.js and more. - yyjson
C- Fast, portable ANSI C library with read, write and mutable-document support. - cJSON
C- Ultralightweight parser in a single C file, widely used in embedded projects. - nlohmann/json
C++- The most widely used C++ JSON library, designed around STL-like ergonomics rather than raw speed. - Glaze
C++- Reflection-based JSON library for C++23 that maps structs directly with no per-type boilerplate. - serde_json
Rust- The de-facto JSON library for Rust, built on serde. - simd-json
Rust- Port of simdjson to Rust with a serde-compatible API. - Jackson
Java- The standard streaming JSON parser and data-binding stack on the JVM. - sonic
Go- JIT and SIMD-accelerated JSON for Go. - go-json
Go- Drop-in replacement for encoding/json with much higher throughput. - jsonparser
Go- Allocation-free JSON access without building a tree. - orjson
Python- Fast JSON library implemented in Rust. - msgspec
Python- Fast JSON (and MessagePack) with schema validation through typed structs.
- libyaml
C- Reference C parser and emitter, used by many language bindings. - PyYAML
Python- The standard Python YAML library; YAML 1.1, with optional libyaml acceleration. - ruamel.yaml
Python- YAML 1.2 with round-trip comment preservation. - yaml
JavaScript- Parses YAML 1.1 and 1.2 into a full document model with comments preserved. - js-yaml
JavaScript- Widely used YAML 1.2 parser and dumper for Node.js and browsers. - go-yaml
Go- Community-maintained continuation of the archived go-yaml/yaml package, under the yaml organization. - goccy/go-yaml
Go- Independent YAML implementation for Go with better error messages and YAML path queries. - SnakeYAML
Java- The standard YAML library on the JVM; SnakeYAML Engine covers YAML 1.2. - yaml-cpp
C++- YAML 1.2 parser and emitter with a DOM-style API. - rapidyaml
C++- Very fast YAML parser that works in place on the source buffer. - YamlDotNet
C#- YAML parser and serializer for .NET. - saphyr
Rust- Maintained continuation of yaml-rust with a YAML 1.2 parser. - serde_yaml_ng
Rust- Conservative fork of the archived serde_yaml for serde users.
- toml++
C++- Header-only TOML v1.0 parser and serializer. - toml11
C++- Header-only TOML parser and serializer with detailed error messages and TOML v1.1 support. - toml-rs
Rust- Used by Cargo itself; toml_edit preserves formatting. - tomli
Python- The library that became the standard tomllib in Python 3.11; still the backport for older versions. - tomlkit
Python- Style-preserving TOML parser and editor used by Poetry. - BurntSushi/toml
Go- The most widely used TOML library for Go, with struct decoding. - go-toml
Go- TOML v1.0 with query and editing support. - smol-toml
JavaScriptTypeScript- Small, fast, spec-compliant TOML 1.0 parser and serializer. - Tomlyn
C#- TOML parser and writer for .NET with a syntax tree that preserves formatting. - tomlj
Java- TOML 1.0 parser for Java with position-aware errors.
- libxml2
C- The XML toolkit behind most language bindings (lxml, Nokogiri, PHP, Perl); includes an HTML parser. - Expat
C- Stream-oriented (SAX-style) XML parser with a long history in Python, Apache and elsewhere. - pugixml
C++- Light, fast DOM parser with XPath support. - TinyXML-2
C++- Small DOM parser aimed at games and embedded use. - quick-xml
Rust- Fast pull parser and writer with serde support. - roxmltree
Rust- Read-only DOM built for speed and strictness on untrusted input. - lxml
Python- Bindings to libxml2 and libxslt; fast XML and HTML with XPath and XSLT. - fast-xml-parser
JavaScript- Pure JavaScript XML to object parser and builder with validation. - Woodstox
Java- High-performance StAX (pull) parser that underpins Jackson's XML support.
- rust-csv
Rust- Fast, flexible CSV reader and writer with serde integration. - PapaParse
JavaScript- Browser and Node.js CSV parser with streaming, workers and header handling. - node-csv
JavaScript- Full CSV toolkit for Node.js: parse, stringify, transform and generate, with streaming. - CsvHelper
C#- Reads and writes CSV with class mapping; the long-standing .NET choice. - Sep
C#- Modern, SIMD-accelerated CSV parser for .NET. - Apache Commons CSV
Java- Reads and writes CSV with predefined dialects (Excel, MySQL, RFC 4180).
- markdown-it
JavaScript- CommonMark-compliant, pluggable, fast. - marked
JavaScript- Lightweight compiler with a long history. - micromark
JavaScript- Small, CommonMark-compliant state machine; the engine under remark. - remark
JavaScript- Markdown as an AST (mdast) with a huge plugin ecosystem. - comrak
Rust- CommonMark and GitHub Flavored Markdown; port of cmark-gfm. - pulldown-cmark
Rust- Pull-parser style, fast and allocation-light. - goldmark
Go- CommonMark-compliant and extensible; used by Hugo. - cmark
C- Reference CommonMark implementation. - md4c
C- Very fast CommonMark parser used by Qt and many desktop applications. - markdown-it-py
Python- Python port of markdown-it. - mistune
Python- Fast Markdown parser in pure Python with a plugin and renderer API. - league/commonmark
PHP- CommonMark and GFM parser with an extension API; the standard PHP choice. - Markdig
C#- Fast, extensible CommonMark parser for .NET with a full syntax tree. - commonmark-java
Java- Java port of the CommonMark reference parser with GFM extensions. - flexmark-java
Java- Highly configurable CommonMark parser that can emulate other Markdown dialects. - commonmarker
Ruby- Ruby bindings to comrak, successor to GitHub's cmark-gfm bindings.
- html5ever
Rust- Spec-compliant HTML5 parser from the Servo project. - lol-html
Rust- Low-latency streaming HTML rewriter from Cloudflare. - scraper
Rust- HTML parsing and CSS selector querying on top of html5ever. - parse5
JavaScript- Spec-compliant HTML parser used by jsdom and Angular. - htmlparser2
JavaScript- Fast, forgiving streaming HTML and XML parser. - cheerio
JavaScript- Traversal in the jQuery style over parse5 or htmlparser2. - jsoup
Java- HTML5 parser with CSS selectors and a cleaner. - AngleSharp
C#- Full W3C DOM implementation for .NET. - Html Agility Pack
C#- Forgiving HTML parser with XPath and LINQ access. - Nokogiri
Ruby- HTML and XML parsing on libxml2 and Gumbo with CSS and XPath queries. - selectolax
Python- Fast HTML5 parser bound to Modest/Lexbor. - x/net/html
Go- Tokenizer and tree builder from the Go team, following the HTML5 spec. - Lexbor
C- Fast HTML and CSS engine.
- csstree
JavaScript- Detailed CSS parser with syntax validation. - postcss
JavaScript- Parses to an AST and drives the largest CSS plugin ecosystem. - lightningcss
RustJavaScript- Extremely fast CSS parser, transformer and minifier. - cssparser
Rust- Servo's CSS tokenizer and parser. - tinycss2
Python- Low-level tokenizer and parser following the CSS Syntax Level 3 spec; used by WeasyPrint. - ph-css
Java- CSS 3 parser and object model for Java. - ExCSS
C#- CSS 3 parser for .NET that produces a stylesheet object model. - PHP-CSS-Parser
PHP- Parses CSS into an object model.
- sqlparser-rs
Rust- Extensible SQL lexer and parser supporting many dialects. - sqlglot
Python- SQL parser, transpiler and optimizer across 20+ dialects. - sqlparse
Python- Non-validating SQL parser, formatter and statement splitter. - libpg_query
C- The real PostgreSQL parser as a library, with bindings for Ruby (pg_query), Python (pglast), Go, Node.js and Rust. - JSqlParser
Java- Parses SQL into a traversable object hierarchy. - Apache Calcite
Java- SQL parser and planner framework used by many query engines. - node-sql-parser
JavaScript- Parses SQL to AST and back for several dialects. - sql-parser-cst
JavaScriptTypeScript- Concrete syntax tree parser that preserves comments and whitespace for several dialects. - vitess sqlparser
Go- MySQL-dialect parser from Vitess. - TiDB parser
Go- MySQL-compatible parser from TiDB, usable on its own. - GoogleSQL
C++- Google's SQL parser and analyzer (formerly ZetaSQL) shared by BigQuery and Spanner.
- dateparser
Python- Human-readable dates in many languages. - dateutil
Python- The standard flexible date parser for Python. - chrono
JavaScript- Natural language date parser ("next Friday at 3pm"). - date-fns
JavaScript- Modular date utilities including format-string parsing. - when
Go- Natural language date/time parser. - go-dateparser
Go- Port of Python's dateparser with its multilingual date formats. - Duckling
Haskell- Rule-based extraction of dates, times, durations and amounts from text in many languages. - Recognizers-Text
C#JavaScriptPythonJava- Multilingual recognition of dates, numbers, units and more.
- ada
C++- WHATWG-compliant URL parser used by Node.js; bindings for Rust, Python, Go and more. - rust-url
Rust- WHATWG URL parser from Servo. - whatwg-url
JavaScript- Reference implementation of the WHATWG URL Standard, used by jsdom. - uriparser
C- RFC 3986 URI parser with normalization and reference resolution. - libphonenumber
JavaC++JavaScript- Phone number parsing and validation. - node-semver
JavaScript- The semantic version parser and range matcher used by npm.
- llhttp
CTypeScript- HTTP/1.x parser generated from a TypeScript description; the parser inside Node.js. - httparse
Rust- Zero-copy, push-based HTTP/1.x parser used by hyper. - picohttpparser
C- Tiny, fast HTTP/1.x parser from the H2O project.
- Kaitai Struct
C++C#GoJavaJavaScriptPythonRuby- Describe a binary format in YAML and generate parsers for a dozen languages. - binrw
Rust- Derive-based binary reading and writing. - deku
Rust- Bit-level declarative binary parsing via derive. - goblin
Rust- Cross-platform ELF, PE and Mach-O parser with no_std support. - Construct
Python- Declarative binary parser and builder. - pyelftools
Python- Pure-Python ELF and DWARF parsing. - LIEF
C++Python- Parse and modify ELF, PE, Mach-O and more. - Wuffs
C- Memory-safe language for writing hardened decoders of untrusted file formats. - Pattern Language
C++- The ImHex language for describing binary structures, with a standalone evaluator. - Apache Daffodil
JavaScala- Open-source DFDL implementation for describing and parsing fixed text and binary formats. - scodec
Scala- Combinators for binary encoders and decoders with bit-level precision. - binary-parser
JavaScript- Declarative binary parser builder for Node.js that generates parsing code at runtime. - calamine
Rust- Pure Rust Excel/OpenDocument spreadsheet reader.
Parsers for programming languages, usable as libraries. For editor-grade incremental trees, tree-sitter above has grammars for most of these languages too.
- SWC
Rust- Fast JavaScript/TypeScript parser and compiler. - oxc
Rust- JavaScript/TypeScript tooling with one of the fastest parsers available. - acorn
JavaScript- Small, fast ECMAScript parser. - espree
JavaScript- ESLint's parser, built on acorn, now maintained in the eslint/js monorepo. - meriyah
JavaScript- Fast, spec-compliant ECMAScript parser with ESTree output. - @babel/parser
JavaScript- Babel's parser with plugin support for proposals. - TypeScript
TypeScript- The TypeScript compiler API, which is also the reference parser for the language. - Boa
Rust- JavaScript engine with a standalone parser crate. - syn
Rust- Parses Rust token streams into a syntax tree; the backbone of proc macros. - JavaParser
Java- Parse, analyze, transform and generate Java code. - Spoon
Java- Source code analysis and transformation for Java. - scalameta
Scala- Parsers and syntax trees for Scala, used by Scalafmt and Metals. - Prism
CRuby- Ruby's official error-tolerant parser, shared by CRuby, JRuby and TruffleRuby. - swift-syntax
Swift- Apple's library for parsing, inspecting and rewriting Swift source. - libclang
CC++- Stable C interface to Clang for parsing C, C++ and Objective-C. - pycparser
Python- Complete C99 parser in pure Python; used by cffi. - PHP-Parser
PHP- PHP parser written in PHP, used by many static analyzers. - go/parser
Go- Go's own parser from the standard library. - ast
Python- Python's standard-library parser; see also libcst for lossless trees. - parso
Python- Error-tolerant Python parser with round-trip support; powers Jedi. - JuliaSyntax.jl
Julia- Julia's reference parser with precise source locations and error recovery. - mvdan/sh
Go- Shell parser, formatter and interpreter for POSIX shell, Bash and mksh. - HCL
Go- HashiCorp Configuration Language parser used by Terraform and friends. - wasm-tools
Rust- Bytecode Alliance tooling including wasmparser, the standard WebAssembly binary parser. - slang
C++- Fast, complete SystemVerilog parser and analysis library. - Verible
C++- SystemVerilog parser, linter and formatter.
- Crafting Interpreters - Free book covering scanning, recursive-descent parsing and more, in Java and C.
- A Compiler Writing Journey - Incremental, hands-on compiler construction in C.
- Parsing Techniques: A Practical Guide (Grune & Jacobs) - The reference text on parsing algorithms.
- Parsing Expression Grammars (Ford, 2004) - The original PEG paper.
- Which Parsing Approach? - Laurence Tratt weighs recursive descent, PEG, LR and generalized parsing, and makes the case for LR.
- Simple but Powerful Pratt Parsing - Operator-precedence parsing explained with a small Rust implementation.
- Pratt Parsers: Expression Parsing Made Easy - The classic walkthrough of Pratt parsing, in Java.
- Resilient LL Parsing Tutorial - Error-tolerant hand-written parsing, by the rust-analyzer author.
- Earley Parsing Explained - Tutorial series that builds an Earley parser step by step.
- Parsing: a timeline - History of parsing theory from the 1960s to today, by the Marpa author.
- Writing a PEG parser for fun and profit - Guido van Rossum on the design of CPython's PEG parser.
- Tree-sitter: a new parsing system for programming tools - Max Brunsfeld's Strange Loop talk on incremental parsing for editors.
- Parsing JSON is a Minefield - Test suite and write-up showing how differently JSON parsers handle edge cases.
- AST Explorer - Explore the ASTs produced by dozens of parsers in the browser.
Contributions welcome. Read contributing.md first; it covers the entry format, the 24-month activity rule, where things go, and how the graveyard works. In short: one entry per pull request, canonical repository link, language tag, one factual sentence.