Skip to content

Expression Simplifier

Simplify an algebraic expression with variables using the mathjs rule-based simplifier. It combines like terms, folds constants, cancels identical factors and keeps fractions exact, so 2x + 3x - x/2 becomes x * 9 / 2. The result is shown as text and as LaTeX, plus its decimal value when no variables remain, rounded to your chosen precision. Input runs in a restricted sandbox with a time limit. Good for algebra practice and tidying formulas.

Reset

Frequently asked questions

What kinds of simplification are done?

The simplifier combines like terms such as 2x + 3y - x + y into x + 4 * y, folds numeric constants, turns x * x into x ^ 2, cancels x / x to 1 and keeps rational coefficients as exact fractions. It applies the mathjs simplification rules repeatedly until nothing changes. The result is mathematically equivalent to the input.

Does it expand or factor polynomials?

No, products and powers such as (x + 1)^2 are kept as they are, and polynomials are not factored, so (x^2 - 1) / (x - 1) is not reduced to x + 1. The mathjs rules focus on combining and cancelling, not on expanding. This keeps results compact for long expressions.

Are trigonometric identities applied?

No, identities such as sin(x)^2 + cos(x)^2 = 1 are not part of the rule set, so such terms are left unchanged. Functions of constants are evaluated, so log(e) becomes 1. Functions of variables are kept symbolically.

Why does sqrt(8) become a decimal?

mathjs evaluates functions whose arguments are all numbers, so sqrt(8) becomes 2.8284271247461903 instead of 2√2. Plain arithmetic on numbers stays exact, so 2/4 + 1/4 becomes 3/4. Radicals of plain numbers are therefore shown as decimals, while radicals of variables such as sqrt(x) stay symbolic.

How do I write the expression?

Use ^ for powers, * or a space for multiplication, / for division and parentheses for grouping, for example 3x^2 + 2x - x^2 / 2. Variable names start with a letter and may contain digits and underscores. Note that xy is a single variable named xy, so write x*y for a product.

What is the decimal value row?

When the simplified expression contains no variables, the tool also evaluates it and shows the decimal value rounded to your chosen precision. For 2/4 + 1/4 that is 0.75. Expressions with variables only show the symbolic result.

What is the LaTeX output for?

The LaTeX row contains the simplified expression as LaTeX code, ready to paste into a paper, a slide or a Markdown editor with math rendering. It is generated by mathjs from the same result. Fractions are written with \frac.

Which functions and constants can I use?

Trigonometric, inverse and hyperbolic functions, sqrt, cbrt, exp, log, log10, log2, abs, round, floor, ceil, factorial and other scientific functions are allowed, together with the constants pi, e, tau, phi and i. Names of built-in functions cannot be used as variables. Unknown functions are rejected with their name.

Is it safe to paste any expression?

Yes, the expression is parsed and checked against an allowlist before anything runs. Assignments, function definitions, strings, ranges, indexing and functions such as import, evaluate and parse are rejected, following the mathjs security guidance. The work runs in an isolated worker with a 3 second time limit.

Are there size limits?

Expressions can be up to 2000 characters and at most 64 levels deep. Very long expressions can take mathjs a long time to simplify, so a calculation that exceeds 3 seconds stops with a message asking for a shorter expression. Split large expressions into parts in that case.

About OneClick Pro

OneClick Pro is a free collection of more than 150 web tools for everyday work: converting images and units, formatting and validating code, checking domains and SEO, and working with text, dates and numbers. Every tool runs without registration or subscription, and what you enter is only used to calculate your result and is never stored. Use it as a quick toolbox for one-off tasks, or bookmark the tools you rely on every day.