# codeplea/tinyexpr

tiny recursive descent expression parser, compiler, and evaluation engine for math expressions

Repository: https://github.com/codeplea/tinyexpr
Canonical: https://ross.abutalabs.com/products/tinyexpr
Homepage: https://codeplea.com/tinyexpr
Language: C
License: Zlib
License Family: permissive
Topics: c, calculator, expression-evaluator, math, parser, recursive-descent, single-file, tiny
Last push: 2026-08-06T03:37:29+00:00

## Health v2 (maintenance only)
Score: 97/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 96, release rhythm 96, longevity 100
- inputs: {"age_days": 3877, "days_push": 27, "days_rel": 27, "gap_med": 0, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1919, forks 309 (observed 2026-08-28T04:05:55.048882+00:00)

## What it is
TinyExpr is a small recursive descent parser, compiler, and evaluation engine for math expressions in C. It ships as a single source and header file with no dependencies, supporting standard operators, C math functions, custom functions, and runtime variable binding.

## Use cases
- evaluate math expressions at runtime in C
- add a calculator to my application
- parse user-entered formulas like sqrt(3^2+4^2)
- bind variables into math expressions at eval time
- embed a tiny expression evaluator in an embedded project
- support custom math functions in a formula parser

## When to choose
- you need a tiny, dependency-free C library for evaluating math expressions
- you want a single-file solution that is easy to integrate and thread-safe
- you need runtime variable binding and custom function support

## When to avoid
- you need symbolic math, algebra, or arbitrary-precision arithmetic
- you need a full expression language with strings, arrays, or control flow
- your project is not in C/C++ or a language with C interop

## Facets
- artifact type: library
- maturity: stable
- function: parser, interpreter, math
- domain: developer-tools, parsers
- platform: c, cpp, embedded, cross-platform
- tags: expression-evaluator, recursive-descent, single-file, calculator, no-dependencies, thread-safe, algorithms

## Member repositories
- codeplea/tinyexpr (main) score 97

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:55.048882+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:09:57.899471+00:00, confidence not recorded.
  - readme: https://github.com/codeplea/tinyexpr (fetched 2026-08-28T04:05:55.048882+00:00, sha e9a8cab16eb6)
  - homepage: https://codeplea.com/tinyexpr (fetched 2026-08-29T10:49:14.617203+00:00, sha b42846612747)
  - site_page: https://codeplea.com/about (fetched 2026-08-29T10:49:14.626175+00:00, sha 5f92223ee9f2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
