Absolute Value Calculator: Complete Guide to |x|, Complex Modulus, Distance, Signum, and Real-World Applications
Absolute value is one of the most fundamental operations in mathematics. Denoted |x| and pronounced "the absolute value of x," it strips away the sign of a number, leaving only its magnitude — its distance from zero on the number line. While the concept seems simple (just "make it positive"), absolute value has deep connections to distance metrics, complex analysis, vector norms, optimization, signal processing, and error measurement. This calculator computes absolute value for real numbers, fractions, and complex numbers, with an interactive graph showing the iconic V-shape curve for reals or the complex plane for complex inputs.
Formal Definition
The absolute value of a real number x is defined piecewise: |x| = x if x ≥ 0, and |x| = −x if x < 0. This means positive numbers and zero stay unchanged, while negative numbers are negated to become positive. Examples: |7| = 7, |−7| = −(−7) = 7, |0| = 0. An equivalent definition uses square roots: |x| = √(x²), which automatically returns the non-negative value regardless of sign. This second form generalizes naturally to complex numbers: |a+bi| = √(a²+b²).
Equivalent: |x| = √(x²)
Complex: |a+bi| = √(a²+b²)
Properties:
|x| ≥ 0 (non-negativity)
|x| = 0 ⇔ x = 0 (definiteness)
|xy| = |x|·|y| (multiplicativity)
|x+y| ≤ |x|+|y| (triangle inequality)
|x| = |−x| (symmetry)
Signum: sign(x) = x/|x| for x≠0
Decomposition: x = sign(x) · |x|
The Absolute Value Graph: The V-Shape
The function y = |x| produces the iconic V-shaped graph with its vertex at the origin (0, 0). For x ≥ 0, the graph is the line y = x (slope +1). For x < 0, it is the line y = −x (slope −1). The graph is symmetric about the y-axis, reflecting the property |x| = |−x|. Our interactive visualization draws this V-shape with a gradient curve, fills the area beneath it, shows the vertex point, and marks both the input value and its mirror image. You can drag to pan and scroll to zoom to explore how the function behaves at any scale.
Complex Modulus
For a complex number z = a + bi, the absolute value (called the modulus) is |z| = √(a² + b²) — the Euclidean distance from the origin in the complex plane. For example, |3+4i| = √(9+16) = √25 = 5. Our calculator detects complex input and switches the graph to a complex plane view, showing the point z, its distance line to the origin, a dashed circle of radius |z|, and the real and imaginary projections. The modulus satisfies the same properties as real absolute value, making it a true generalization of the concept.
Triangle Inequality
The most important absolute value property is the triangle inequality: |x+y| ≤ |x| + |y|. This says that the absolute value of a sum is at most the sum of the absolute values. Equality holds when x and y have the same sign (or one is zero). This inequality is fundamental throughout mathematics: it defines what makes a "distance" function (a metric), it provides bounds in analysis and optimization, and it generalizes to vector norms (||u+v|| ≤ ||u|| + ||v||). The reverse triangle inequality also holds: ||x| − |y|| ≤ |x − y|, bounding how much absolute values can differ.
Signum Function and Decomposition
Every real number x can be decomposed as x = sign(x) · |x|, where sign(x) (the signum function) equals +1 for x > 0, −1 for x < 0, and 0 for x = 0. This separates "direction" from "magnitude." The signum function appears in physics (direction of force), optimization (subgradient of |x|), and signal processing (hard limiter). Our calculator displays the signum value alongside the absolute value, making this decomposition explicit. In higher dimensions, sign generalizes to the unit vector: û = v/||v||.
Absolute Value in Real-World Applications
Absolute value appears throughout science and daily life. Error measurement: the absolute error |measured − actual| quantifies how far off a measurement is. Distance: the distance between points a and b on a number line is |b − a|. Temperature: "how far from freezing" is |T − 0°|. Finance: absolute return ignores direction (gain vs loss). Signal processing: rectification converts AC to DC using |signal|. Optimization: L1 regularization uses Σ|wᵢ| to encourage sparse solutions (Lasso regression). Machine learning: mean absolute error (MAE) = (1/n)Σ|yᵢ − ŷᵢ| is a robust loss function.
Solving Absolute Value Equations
An equation like |x − 3| = 7 is solved by considering two cases: x − 3 = 7 (giving x = 10) and x − 3 = −7 (giving x = −4). More generally, |f(x)| = c (with c > 0) yields f(x) = c or f(x) = −c. If c = 0, then f(x) = 0. If c < 0, there is no solution. Absolute value inequalities: |x| < c means −c < x < c (an interval), while |x| > c means x < −c or x > c (two rays). These principles are used throughout algebra, calculus, and epsilon-delta proofs in real analysis.
How to Use This Calculator
Enter any value: a real number (−7.5), a fraction (−5/3), or a complex number (3+4i). The calculator automatically detects the input type. For real numbers, the graph shows the y = |x| V-curve with your point and its mirror highlighted. For complex numbers, the graph switches to the complex plane showing the modulus as a distance vector. All properties display: |x|, −|x|, x², √|x|, and sign(x). The step-by-step section walks through the definition, computation, and verification. Drag the graph to pan, scroll to zoom, and hover to read coordinates.