Double Vertical Bar in LaTeX (\|)

∥\|
LaTeX command
\|
Package
No package needed: built into LaTeX
Mode
Math mode only
Copy the Unicode character
∥U+2225

Where it is used

Double vertical bar, the delimiter for norms and the symbol for parallel in some contexts.

\| prints two vertical lines and is mostly used in pairs for norms, \|x\|. As a plain symbol it has ordinary spacing, so when you mean the relation is parallel to, use \parallel, which adds relation spacing. For norms, \lVert and \rVert are recommended, because they tell LaTeX which side opens and closes, giving correct spacing next to operators and minus signs. It can be sized with \left\| ... \right\| or \big\|. In text mode \| does not give the bars; use \textbardbl or switch to math.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

∥x∥2=x12+x22+⋯+xn2\|x\|_2 = \sqrt{x_1^2 + x_2^2 + \cdots + x_n^2}
\documentclass{article}
\begin{document}
Double Vertical Bar: $\|$

\[ \|x\|_2 = \sqrt{x_1^2 + x_2^2 + \cdots + x_n^2} \]
\end{document}

Related symbols

All Brackets at Delimiters →

Frequently asked questions

How do I write Double Vertical Bar in LaTeX?
Type \| in math mode, for example $\|x\|_2 = \sqrt{x_1^2 + x_2^2 + \cdots + x_n^2}$. It works in plain LaTeX without loading any package.
Which package do I need for \|?
None. \| is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \| in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\|$ in running text. If you only need the glyph in text, paste the Unicode character ∥ instead (with XeLaTeX or LuaLaTeX and a font that has it).
Math poweredSumulat ng LaTeX gamit ang AI

Pinakamahusay na AI LaTeX Editor, Alternatibo sa Overleaf

Tinutulungan ng Octree ang mga researcher mula sa 15+ na unibersidad na sumulat ng research papers nang mas mabilis gamit ang AI

  • Gumawa ng magagandang TikZ diagrams gamit ang AI
  • Mag-upload ng larawan at i-convert ito sa LaTeX nang walang problema
  • Makakuha ng instant na tulong sa pagsulat at pag-format ng research papers