Skip to content
latexci
PreviewDiffWord → LaTeXBibTeXSymbolsTableTemplatesAcademics
Sign inFree
PreviewDiffWord → LaTeXBibTeXSymbolsTableTemplatesAcademicsFree
Discord community ↗GitHub ↗
Sign in
LaTeX symbols›Accents›Bar

Bar in LaTeX

The LaTeX command for bar is \bar{x} (overbar / mean).

xˉ\bar{x}xˉ
\bar{x}
Accents · no package needed

Writing a paper? The table generator and the BibTeX cleaner are one click away, no account.

Which command should you use?

CommandPackageUse it when
\bar{x} recommendednoneShort bar over one letter: the sample mean.
\overline{AB} noneBar over the whole argument: a segment.
\overline{z + w} noneComplex conjugate of an expression.
\={o} noneMacron in running text.
Table 1. Ways to write bar in LaTeX. Every line was compiled with pdfLaTeX (TeX Live 2026) loading only the package shown.
Common mistake. \bar has a fixed width, so over two or more letters it looks too short: use \overline.

How to type Bar

Write \bar{x} inside math mode, that is between $…$ for inline math or in a \[ … \] or equation block for display math. It is part of core LaTeX math, so no extra package is required.

Example
$\bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i$xˉ=1n∑i=1nxi\bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_ixˉ=n1​i=1∑n​xi​

Open this example in the live preview: it renders as you type, with no compiler and no signup.

Often confused with

  • Hat \hat{x}: hat / estimate
  • Widehat \widehat{xy}
  • Overline \overline{x}: overline (longer than \bar)

Related Accents symbols

x̆\breve{x}x̊\mathring{x}x̂\widehat{xy}x̃\widetilde{xy}x̲\underline{x}x̂\hat{x}x̃\tilde{x}x̄\overline{x}x\overbrace{x}^{n}x\underbrace{x}_{n}x⃗\vec{x}ẋ\dot{x}ẍ\ddot{x}x́\acute{x}

Math accents in LaTeX: the full table or search all 350+ LaTeX symbols.

FAQ

How do you write bar (x̄) in LaTeX?

Use \bar{x} in math mode; it needs no extra package. For example, $\bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i$.

Which package provides \bar{x}?

None: \bar{x} is built into LaTeX, so no extra package is required.

What is the most common mistake with bar in LaTeX?

\bar has a fixed width, so over two or more letters it looks too short: use \overline.

latexci

Free LaTeX tools for researchers and students, in any browser. No paid plan, no advertising.

Star on GitHubBuy me a coffee

Tools

Live PreviewBibTeX ToolsDOI → BibTeXarXiv → BibTeXPubMed → BibTeXISBN → BibTeXLaTeX DiffWord → LaTeXSymbol SearchTable GeneratorTemplatesCV Generator

Learn

Academics hubLife after OverleafFreeGitHub

Community

DiscordGitHub IssuesFeature Requests

© 2026 latexci. By Sitraka Forler, sitraka.lu

PrivacyTerms