Why we built this
Every developer has been there: you need to quickly verify what null == null returns, or
whether 0 || false || "fallback" short-circuits correctly. The options are either opening
DevTools, spinning up a REPL, or mentally simulating the JavaScript spec. None of those are fast.
expr started as an internal scratch tool — a single input box that ran Function('"use strict"; return
(' + expr + ')') and printed the result. It was five lines of JavaScript. We added history. Then
syntax highlighting on the result. Then an API so you could calculate expressions from curl. At some point
it became a real product.
The best developer tools feel like they were always there — you just needed someone to make them obvious.
What is included in version 1.0?
This release is the foundation. Everything you need to calculate, understand, and integrate JavaScript expressions, with no configuration and no installation required.
+ - * / %)
LOGICAL AND, LOGICAL OR and many more.
== != < > <= >=)
? :)
POST request
The Expression Calculator in action
Open expression calculator, type an expression, and press Enter. That's the whole interface. No accounts, no configuration, no JavaScript to import. The result appears instantly — success states in green, errors in red, with the calculated source shown below.
Here are a few expressions worth trying on your first run:
// Arithmetic 2 * 10 → 20 17 % 5 → 2 // Logical short-circuit true || false || true → true // Comparison "5" == "5" → true "5" == 5 → error, Unsupported operation == for Number and String. // Ternary 42 > 10 ? "big" : "small" → "big"
Under the hood
Expression calculator is a tool whose entire purpose is evaluating all kinds of expressions. It catches a class of common mistakes like undeclared variables, while still allowing the full expression language.
Results are not stored on server or localStorage, but your history persists during
sessions. No server round-trip, no account required — your expressions never leave your browser.
The REST API
For server-side and CI use cases, expression calculator ships a REST API via RapidApi that accepts any
expression and returns a structured JSON response. Authentication uses API key passed in the Authorization
header.
# Simple GET request curl "https://api.expr.dev/v1/evaluate?expr=2**10" \ -H "Authorization: Bearer YOUR_KEY" # Response { "ok": true, "result": 1024, "type": "number", "expr": "2**10" }
Error responses follow the same schema — ok: false with a human-readable error
field and an errorType for programmatic handling. See the operator
reference for the full list of evaluable expressions and their expected return types.
What's next
Initial version covers the core expression set. Here's what's on the roadmap for v1.1 and beyond:
- Batch evaluation — send an array of expressions in one request, get an array of results
If there's something you'd like to see, let us know. The roadmap is shaped almost entirely by what developers actually need.