How to Write a Norm in LaTeX
Write the norm of x as \lVert x \rVert, which gives ‖x‖ with correct opening and closing spacing. \|x\| prints the same bars. Around tall content use \left\lVert … \right\rVert, and add the norm type as a subscript: \lVert x \rVert_2.
Norm notation
\lVert x \rVertNorm with left and right delimiters (amsmath); the preferred form.
\|x\|Same double bar; fine for simple cases.
\left\lVert \frac{a}{b} \right\rVertBars that grow with the content.
\bigl\lVert x \bigr\rVertOne size larger, set by hand (also
\Bigl,\biggl).\lVert x \rVert_{\infty}Norm type as a subscript: 1, 2, ∞, F, op.
- Text mode, no math preview
\DeclarePairedDelimiter\norm{\lVert}{\rVert}mathtools: then
\norm{x},\norm*{…}auto-sizes.
Try it live
Change the formula and the preview redraws as you type. Copy the LaTeX, download a PNG or SVG, copy it for Word, or use Edit here on any example below to load it.
Norm examples
Each result below is drawn from the LaTeX under it. Copy the code, edit it on this page, or open it in the full editor.
Euclidean (L2) norm
LaTeX\lVert x \rVert_2 = \sqrt{x_1^2 + x_2^2 + \cdots + x_n^2}L1 norm
LaTeX\lVert x \rVert_1 = \sum_{i=1}^{n} \lvert x_i \rvertMaximum norm
LaTeX\lVert x \rVert_{\infty} = \max_{i} \lvert x_i \rvertTriangle inequality
LaTeX\lVert x + y \rVert \le \lVert x \rVert + \lVert y \rVertFrobenius norm
LaTeX\lVert A \rVert_F = \sqrt{\sum_{i,j} \lvert a_{ij} \rvert^2}Sized around a fraction
LaTeX\left\lVert \frac{x}{\lVert x \rVert} \right\rVert = 1
Why \lVert and \rVert
\| is one symbol used on both sides, so LaTeX cannot tell opening from closing and may space it badly after operators, for example in -\|x\|. \lVert and \rVert are marked as opening and closing delimiters, the same way \lvert and \rvert are for absolute values.
A \norm macro
In a document with many norms, define the command once with mathtools. \norm{x} gives normal-size bars, \norm*{\frac{a}{b}} grows them like \left … \right, and \norm[\big]{x} picks a size.
\usepackage{mathtools}
\DeclarePairedDelimiter\norm{\lVert}{\rVert}
...
$\norm{x}_2 \le \norm*{\frac{x}{2}}$Common mistakes
Four keyboard bars are two pairs of single bars with gaps between them, not a double bar.
Instead of||x||Write\lVert x \rVertFixed-size bars look too short next to a fraction.
Instead of\| \frac{a}{b} \|Write\left\lVert \frac{a}{b} \right\rVert\normis not built in; define it first (MathJax and KaTeX do not have it either).Instead of\norm{x} (no definition)Write\DeclarePairedDelimiter\norm{\lVert}{\rVert}
In Overleaf, MathJax and Word
Overleaf and pdfLaTeX
\lVert/\rVertneed amsmath;\DeclarePairedDelimiterneeds mathtools.\|works without packages.MathJax and KaTeX
MathJax and KaTeX support
\lVert,\rVert,\|and\left … \right. Define\normwith\newcommandif your platform allows macros.Microsoft Word
In a Word equation type
\normthen Space for ‖, or use Insert › Equation › Bracket. Copy for Word from the editor here pastes norms as editable equations.
Have this math on paper, in a PDF or a photo?
Retyping formulas is slow. These converters read whole pages and handwriting and give you LaTeX or Word with every equation editable.
- Handwritten math to LaTeXPhotograph notes or a whiteboard and get LaTeX for every line.1 credit per image
- PDF to LaTeXTurn a paper or textbook PDF into a .tex project with every equation.10 credits per page
- Image to WordA screenshot or photo of a page becomes Word with editable equations.10 credits per image
Single printed formulas are free: 3 a day without an account, 6 with a free account. New accounts get 30 credits to try handwriting, pages and documents; failed conversions return their credits. See plans and credit prices.
Norm in LaTeX: questions
- How do I write a norm in LaTeX?
\lVert x \rVert, or\|x\|for quick use. Add a subscript for the norm type:\lVert x \rVert_2.- How do I make the norm bars bigger?
- Use
\left\lVert … \right\rVertor a fixed size such as\bigl\lVert … \bigr\rVert. - Is there a \norm command?
- Not by default. Define one with mathtools:
\DeclarePairedDelimiter\norm{\lVert}{\rVert}. - How is a norm different from absolute value in LaTeX?
- A norm uses double bars (
\lVert … \rVert), absolute value single bars (\lvert … \rvert).
Related LaTeX reference
- Absolute Value in LaTeX|x|, \lvert x \rvert, bars that stretch with \left| \right|, double bars for norms, and an \abs macro with mathtools.
- Vector in LaTeX\vec{v} and \overrightarrow{AB}, bold vectors with \mathbf and \boldsymbol, unit vectors, column and row vectors, and norms.
- Binomial Coefficients (Choose) in LaTeX\binom{n}{k} for n choose k, the older {n \choose k}, \dbinom and \tbinom sizes, and multinomial and combination notation.
- Derivative in LaTeXdy/dx with \frac, f'(x) and f''(x), nth derivatives, \dot and \ddot for time derivatives, and what to do about \dv.
- LaTeX equation editorSymbol panel, live preview, and PNG, SVG, MathML or Word export.
- All LaTeX reference pagesSymbols, math structures and text formatting in one list.
Have the formula as a picture?
Paste a screenshot or photo of the equation and get its LaTeX, ready to copy or open in the editor.
Convert an image to LaTeX