What absolute value means
The absolute value of a number is its distance from zero, so it is never negative: |−7| = 7, |7| = 7 and |0| = 0. You write it by putting the number between two vertical bars, a notation introduced by Karl Weierstrass in 1841.
Because distance has no direction, |a − b| gives the gap between two numbers no matter which is bigger. Equations and inequalities with absolute value often have two answers: |x| = 4 means x = 4 or x = −4 (written x = ±4 with the plus minus symbol), and |x − 2| < 4 means −2 < x < 6.
For complex numbers, |z| is called the modulus, and for vectors the double bars ‖v‖ give the length, or norm.
Which vertical bar to use
The plain keyboard bar | (vertical line, also called the pipe) is the right choice for absolute value in everyday text. ∣ is a math relation meaning "divides" (3 ∣ 12) and is also used for "such that" in set notation. ‖ is the double bar for norms, while ∥ means "is parallel to". ¦ (broken bar) has no math meaning.
Avoid typing a lowercase l, a capital I or the digit 1 as a bar. They look similar in some fonts but break formulas and confuse screen readers.
How to type absolute value bars
On US keyboards, | is Shift + backslash (the \ key above Enter). On Windows you can also hold Alt and type 124. On iPhone, tap 123, then #+=. On Android with Gboard, tap ?123, then =\<.
In LaTeX, |x| works, but \lvert x \rvert spaces better and \left| \frac{a}{b} \right| grows with tall content. Use \lVert v \rVert for norms. In Excel and Google Sheets, =ABS(-5) returns 5, and most programming languages have an abs() function. More bracket types are on the bracket symbols page.