Which mean symbol to use
Statistics uses two main symbols for the average. x̄ (x bar) is the mean of a sample, the data you actually collected: add the values and divide by how many there are. μ (the Greek letter mu) is the mean of a whole population, which is usually unknown and estimated with x̄.
The bar works on any variable, so ȳ is the mean of y. A tilde means something else: x̃ is the median. In physics, angle brackets such as ⟨x⟩ are often used for an average instead. To show spread around the mean, add the standard deviation symbol σ.
Why x̄ is two characters
There is no single Unicode character for x bar. x̄ is the letter x followed by U+0304 COMBINING MACRON, a mark with no width of its own that draws a bar over the letter before it. Your device stacks the two when it displays them.
Because the font positions the bar, x̄ can look different from app to app: the bar may sit too high, too low or slightly off center, and older fonts may show it next to the x instead of above it. Copying keeps both parts together, but pressing Backspace may delete only the bar. A few letters have a ready-made version with a bar, such as ā and ȳ, and those display more reliably.
How to type x bar
In Word, type x, then 0304, and press Alt + X to add the bar. In a Word equation (Alt + =), typing x\bar followed by a space also works. In LaTeX, write \bar{x} for a short bar or \overline{x} for a longer one.
In HTML, write x̄, since 772 is the decimal value of U+0304. Most other apps, including phone keyboards, have no bar shortcut, so copying x̄ from this page is the quickest option. Looking for hats instead of bars? See the B hat symbol page, and for capital Σ, the sigma symbol.