# parse() Function & Examples

Use the parse() expression function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## parse

#### parse(expr)

#### parse(expr, options)

#### parse([expr1, expr2, expr3, ...])

#### parse([expr1, expr2, expr3, ...], options)

Try it yourself:

```calculio
node1 = parse("sqrt(3^2 + 4^2)")
node1.evaluate()
code1 = node1.compile()
code1.evaluate()
scope = {a: 3, b: 4}
node2 = parse("a * b")
node2.evaluate(scope)
code2 = node2.compile()
code2.evaluate(scope)
```

[parser](https://calcul.io/function/parser/index.md)

[compile](https://calcul.io/function/compile/index.md)

---

## parse(): turn expression text into a calculation

**parse(text)** reads mathematical text and produces an expression that can be evaluated or transformed. It is the bridge between calculator input and structured mathematics.

## Example

Parsing `2 * (x + 1)` preserves its operators and grouping. It is safer than trying to manipulate a formula with ordinary text replacement.

## Workflow

Use [evaluate()](https://calcul.io/function/evaluate/index.md) to calculate a parsed expression, [simplify()](https://calcul.io/function/simplify/index.md) to transform it, and [numeric()](https://calcul.io/function/numeric/index.md) for an approximation. [parser()](https://calcul.io/function/parser/index.md) supports a reusable evaluation context.

## Caveat

Treat untrusted expression text carefully. Validate expected variables and syntax before evaluating it in a wider application.

[All functions](https://calcul.io/functions/index.md)
