Square Root in LaTeX (\sqrt{x})
- LaTeX command
\sqrt{x}- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
Where it is used
Draws a radical sign over its argument, giving the principal square root of x.
\sqrt automatically stretches the radical to cover whatever you put in braces, so \sqrt{x^2 + y^2} gets a longer vinculum and a taller sign. It is the standard way to write the Euclidean norm, the quadratic formula, and standard deviation as \sqrt{\operatorname{Var}(X)}. Radicals over arguments with different heights can look uneven; adding \vphantom{y} or \mathstrut inside makes neighboring roots match. For an index such as a cube root, use the optional argument \sqrt[3]{x}. In inline text, x^{1/2} is sometimes clearer than a radical over a tall fraction.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Square Root: $\sqrt{x}$
\[ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]
\end{document}Related symbols
- N-th Root
\sqrt[n]{x} - Fraction
\frac{a}{b} - Summation
\sum_{i=1}^{n} - Division
\div - Product
\prod_{i=1}^{n} - Multiplication
\times
Frequently asked questions
- How do I write Square Root in LaTeX?
- Type \sqrt{x} in math mode, for example $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$. It works in plain LaTeX without loading any package.
- Which package do I need for \sqrt{x}?
- None. \sqrt{x} is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use \sqrt{x} in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\sqrt{x}$ in running text.
Best AI LaTeX Editor, Overleaf Alternative
Octree helps researchers from 15+ universities write research papers faster using AI
- Generate beautiful TikZ diagrams using AI
- Upload image and convert it to LaTeX seamlessly
- Get instant assistance with writing and formatting research papers