What x squared means
x² (read "x squared") means x multiplied by itself: x × x. If x = 5, then x² = 25. The small raised 2 is the exponent, and the name comes from geometry: a square with sides of length x has an area of x².
You will see x² all over math and science: in the quadratic ax² + bx + c, in the area of a circle πr², in the Pythagorean theorem a² + b² = c², and in E = mc². The pattern works for any power, so x³ is x cubed and xⁿ is x to the nth power.
x² as text vs x^2
The x² on this page is two plain characters: the letter x and the superscript two ² (U+00B2). Because ² is a real character and not formatting, it keeps its raised look when you paste it into a text message, a comment, a spreadsheet cell or a social bio.
Calculators, spreadsheets and programming languages do not read ² as a power. In Excel and Google Sheets you write =A1^2, on most graphing calculators x^2, and in code a function such as pow(x, 2). Use x² when people will read it and x^2 when a program has to calculate it.
Do not confuse the variable x with the multiplication sign ×. In 3 × 2 the × means times; in x² the x is a number you do not know yet. For a textbook look, use the italic math letter 𝑥².
How to type x²
Type x, then add the ². On Windows, hold Alt and type 0178 on the number pad (or Alt + 253). A Mac has no default key for ², so open the Character Viewer with Control + Command + Space and search for "superscript two", or set up a text replacement such as "xsq" for x².
In Word you can also type a normal 2, select it and press Ctrl + Shift + = to make it superscript; in Google Docs press Ctrl + . (Command + . on a Mac). That formatting disappears in plain-text fields, so copy x² from this page when it has to survive pasting. In HTML, write x², and in LaTeX x^2.
On Android, Gboard shows ² when you long-press the 2 key on the symbols keyboard. iPhone keyboards have no ² key, so save x² as a text replacement in Settings > General > Keyboard > Text Replacement. More raised characters are on the superscript symbols page.