Squared in LaTeX (^2)
- LaTeX command
^2- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
Where it is used
Superscript 2, raising a quantity or unit to the second power, as in x² or square metres.
Typing ^2 attaches the next single token as a superscript; for longer exponents you need braces, x^{12}, since x^12 would give x^1 followed by a 2. Units squared, like \text{m}^2, describe areas, and \text{s}^2 appears in acceleration. Applied to functions, \sin^2 x means (\sin x)^2, a convention that does not extend to \sin^{-1}, which denotes the inverse. Double superscripts like x^2^3 produce an error; write x^{2^3} or (x^2)^3 depending on what you mean. Use \text{m}^2 rather than sq m in scientific text.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Squared: $^2$
\[ A = \pi r^2 = \pi (0.5\,\text{m})^2 \approx 0.785\,\text{m}^2 \]
\end{document}Related symbols
All الوحدات والقياسات →Frequently asked questions
- How do I write Squared in LaTeX?
- Type ^2 in math mode, for example $A = \pi r^2 = \pi (0.5\,\text{m})^2 \approx 0.785\,\text{m}^2$. It works in plain LaTeX without loading any package.
- Which package do I need for ^2?
- None. ^2 is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use ^2 in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $^2$ in running text.
أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf
يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي
- أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
- ارفع صورة وحولها إلى LaTeX بسلاسة
- احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث