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 \rVert
    ‖ x ‖

    Norm with left and right delimiters (amsmath); the preferred form.

  • \|x\|
    ∥ x ∥

    Same double bar; fine for simple cases.

  • \left\lVert \frac{a}{b} \right\rVert
    ‖ a b ‖

    Bars that grow with the content.

  • \bigl\lVert x \bigr\rVert
    ‖ x ‖

    One size larger, set by hand (also \Bigl, \biggl).

  • \lVert x \rVert_{\infty}
    ‖ x ‖ ∞

    Norm type as a subscript: 1, 2, ∞, F, op.

  • \DeclarePairedDelimiter\norm{\lVert}{\rVert}
    Text mode, no math preview

    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.

Templates

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

    ‖ x ‖ 2 = x 1 2 + x 2 2 + ⋯ + x n 2
    LaTeX
    \lVert x \rVert_2 = \sqrt{x_1^2 + x_2^2 + \cdots + x_n^2}
  • L1 norm

    ‖ x ‖ 1 = ∑ i = 1 n | x i |
    LaTeX
    \lVert x \rVert_1 = \sum_{i=1}^{n} \lvert x_i \rvert
  • Maximum norm

    ‖ x ‖ ∞ = max i | x i |
    LaTeX
    \lVert x \rVert_{\infty} = \max_{i} \lvert x_i \rvert
  • Triangle inequality

    ‖ x + y ‖ ≤ ‖ x ‖ + ‖ y ‖
    LaTeX
    \lVert x + y \rVert \le \lVert x \rVert + \lVert y \rVert
  • Frobenius norm

    ‖ A ‖ F = ∑ i , j | a i j | 2
    LaTeX
    \lVert A \rVert_F = \sqrt{\sum_{i,j} \lvert a_{ij} \rvert^2}
  • Sized around a fraction

    ‖ x ‖ x ‖ ‖ = 1
    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.

LaTeX
\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 \rVert
  • Fixed-size bars look too short next to a fraction.

    Instead of
    \| \frac{a}{b} \|
    Write
    \left\lVert \frac{a}{b} \right\rVert
  • \norm is 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/\rVert need amsmath; \DeclarePairedDelimiter needs mathtools. \| works without packages.

  • MathJax and KaTeX

    MathJax and KaTeX support \lVert, \rVert, \| and \left … \right. Define \norm with \newcommand if your platform allows macros.

  • Microsoft Word

    In a Word equation type \norm then 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.

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\rVert or 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).

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