Skip to content
All LaTeX symbols

Bar / overline accent (x̄)

Accents & decorations

x̄

LaTeX command

\bar{x}

short bar over one letter

Use inside math mode: $\bar{x}$ — base LaTeX, KaTeX and MathJax

\bar is for the sample mean (x̄), the complex conjugate and set complements. \overline stretches to cover an expression and is also used for closure and repeating decimals.

All ways to write it

CommandUsePackageCopy
\bar{x}short bar over one letternone
\overline{xyz}bar over a groupnone
\underline{x}bar beneathnone
\bar{z}complex conjugatenone

Example

\bar{x} = \frac{1}{n}\sum_{i=1}^{n} x_i, \qquad \overline{A \cup B} = \bar{A} \cap \bar{B}

A sample mean, and De Morgan's law with overlines.

Questions

\bar or \overline for the mean?

\bar{x}: it is the right size for one letter. \overline is taller and meant for longer expressions.

Related symbols

Using bar in Confluence

Confluence Cloud has no built-in LaTeX. With LaTeX Math for Confluence you add a math macro to any page, type \bar{x} and it renders inline or as a block, with a live preview while you edit. Every command on this page renders there without extra packages.