acalculator

What is the absolute value?

Type a number to get its absolute value, two numbers to get the distance between them, or the parts of an absolute value equation to get every solution. The absolute value calculator works in exact fractions.

Your numbers

Find
Answer
7

|-7| = 7.

As a decimal
7
Working
|-7| = 7

Answer: 7. |-7| = 7.

How to calculate

Computes the absolute value |x| of a number or fraction, the distance |a − b| between two numbers, or solves the absolute value equation |mx + n| = c, exactly.

Example with the default inputs (Find |x|, Number x -7): |-7| = 7.

Method: |x| = x if x ≥ 0, −x if x < 0; distance = |a − b|; |mx + n| = c gives x = (c − n) ÷ m or x = (−c − n) ÷ m.

  • Inputs are exact: whole numbers, decimals, fractions such as 3/4, or mixed numbers such as 1 1/2.
  • Answers are exact fractions in lowest terms.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Find |x|, Number x -7 gives Answer 7, As a decimal 7, Working |-7| = 7.Source: OpenStax Algebra and Trigonometry 2e, section 2.6, Other Types of Equations: if x < 0, |x| = −x (https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-6-other-types-of-equations, retrieved 2026-10-01)
  2. Find |x|, Number x -3/4 gives Answer 3/4, As a decimal 0.75.
  3. Find |a − b|, Number a 3, Number b 10 gives Answer 7, Working |3 − 10| = 7.
  4. Find |mx + n| = c, m 2, n -1, c 3 gives Working x = -1 or x = 2, Number of solutions 2.Source: OpenStax Algebra and Trigonometry 2e, section 2.6, Other Types of Equations: |2x − 1| = 3 gives x = 2 and x = −1 (https://openstax.org/books/algebra-and-trigonometry-2e/pages/2-6-other-types-of-equations)
  5. Find |mx + n| = c, m 3, n 6, c 0 gives Answer -2, Number of solutions 1.

How it works

Pick what to find, then fill the boxes. Every box takes a whole number (−7), a decimal (2.5), a fraction (3/4, −7/4) or a mixed number (1 1/2). The calculator reads each as an exact fraction, so the answers are exact.

  • |x|: if x is 0 or more, |x| = x; if x is below 0, |x| = −x.
  • |a − b|: the distance between a and b on the number line: subtract, then take the absolute value.
  • |mx + n| = c: solve mx + n = c and mx + n = −c, so x = (c − n) ÷ m or x = (−c − n) ÷ m.

The calculator shows:

  • Answer: the absolute value, the distance, or the solutions, as exact fractions in lowest terms, written as a mixed number when larger than 1 (7/4 shows as 1 3/4). Two solutions show smaller first, joined by "or".
  • As a decimal: the absolute value or the distance, to 12 significant figures, rounded half up.
  • Working: the answer written out, with fractions as a/b (for example |-7| = 7, |3 − 10| = 7, x = -1 or x = 2).
  • Number of solutions (equations only): 1, 2 or "Every number".

Rules

  • In an equation, c below 0 has no answer: "An absolute value is never negative, so there is no solution when c is below 0."
  • With m = 0 the left side is always |n|. If |n| equals c, every number x is a solution (no single answer is shown); otherwise there is no answer: "With m = 0 the left side is always |n|, which is not c: no x solves it."
  • With c = 0 there is one solution, x = −n ÷ m.
  • A box left empty in the chosen mode gives no answer.

Worked examples by hand

|−7|. −7 is below 0, so |−7| = −(−7) = 7.

|−3/4|. −3/4 is below 0, so the answer is 3/4 = 0.75.

Distance between 3 and 10. |3 − 10| = |−7| = 7.

|2x − 1| = 3. m = 2, n = −1, c = 3. x = (3 − (−1)) ÷ 2 = 2, or x = (−3 − (−1)) ÷ 2 = −1.

|3x + 6| = 0. One solution: x = (0 − 6) ÷ 3 = −2.

Other questions people ask

What is an absolute value?

The distance of a number from 0 on the number line, so it is never negative. If x is 0 or more, |x| = x; if x is below 0, |x| = −x. So |−7| = 7 and |7| = 7.

How do I find the absolute value of a fraction?

Drop the minus sign: |−3/4| = 3/4. Type the fraction as 3/4, −3/4 or a mixed number such as 1 1/2.

How do I find the distance between two numbers?

Subtract them and take the absolute value: |a − b|. The distance between 3 and 10 is |3 − 10| = |−7| = 7, the same as |10 − 3|.

How do I solve an absolute value equation?

For |mx + n| = c with c above 0, solve the two equations mx + n = c and mx + n = −c. For |2x − 1| = 3: 2x − 1 = 3 gives x = 2, and 2x − 1 = −3 gives x = −1.

When does an absolute value equation have no solution?

When the right side c is negative, because an absolute value is never below 0. |x + 4| = −2 has no solution. When c is 0 there is exactly one solution.

What happens when m is 0?

Then the left side is |n| for every x. If |n| equals c, every number is a solution; otherwise none is.