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

Hat in LaTeX

The LaTeX command for hat is \hat{x} (hat / estimate).

x^\hat{x}x^
\hat{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
\hat{x} recommendednoneHat over one letter: an estimator, a unit vector.
\widehat{xy} noneWide hat over several letters.
\hat{\beta} noneAn estimated coefficient.
\hat{\imath} noneUnit vector: \imath drops the dot under the hat.
\^{o} noneCircumflex in running text, as in r\^{o}le.
Table 1. Ways to write hat in LaTeX. Every line was compiled with pdfLaTeX (TeX Live 2026) loading only the package shown.
Common mistake. \hat works only in math mode; in text use \^{o}, or type the accented letter directly.

How to type Hat

Write \hat{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
$\hat{\beta} = (X^\top X)^{-1} X^\top y$β^=(X⊤X)−1X⊤y\hat{\beta} = (X^\top X)^{-1} X^\top yβ^​=(X⊤X)−1X⊤y

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

Often confused with

  • Widehat \widehat{xy}
  • Bar \bar{x}: overbar / mean
  • Overline \overline{x}: overline (longer than \bar)

Related Accents symbols

x̀\grave{x}x̌\check{x}x̆\breve{x}x̊\mathring{x}x̂\widehat{xy}x̃\widetilde{xy}x̲\underline{x}x̃\tilde{x}x̄\bar{x}x̄\overline{x}x\overbrace{x}^{n}x\underbrace{x}_{n}x⃗\vec{x}ẋ\dot{x}

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

FAQ

How do you write hat (x̂) in LaTeX?

Use \hat{x} in math mode; it needs no extra package. For example, $\hat{\beta} = (X^\top X)^{-1} X^\top y$.

Which package provides \hat{x}?

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

What is the most common mistake with hat in LaTeX?

\hat works only in math mode; in text use \^{o}, or type the accented letter directly.

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