Real Number Symbol in LaTeX

Write the set of real numbers as \mathbb{R} in math mode, with \usepackage{amssymb} (or amsfonts) in the preamble: $x \in \mathbb{R}$ gives x ∈ ℝ. The other number sets use the same command: \mathbb{N}, \mathbb{Z}, \mathbb{Q} and \mathbb{C}.

Number sets

  • \mathbb{R}
    R

    Real numbers.

  • \mathbb{N}
    N

    Natural numbers.

  • \mathbb{Z}
    Z

    Integers.

  • \mathbb{Q}
    Q

    Rational numbers.

  • \mathbb{C}
    C

    Complex numbers.

  • \mathbb{R}^n
    R n

    n-dimensional real space.

  • \mathbb{R}_{>0}
    R > 0

    Positive reals; \mathbb{R}^{+} is also common.

  • \mathbf{R}
    R

    Bold R, an older convention some journals still prefer.

  • \mathbb{E}[X]
    E [ X ]

    Blackboard E, often used for expected value.

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

Real number symbol ℝ 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.

Package and letters

\mathbb comes from the AMS fonts: load \usepackage{amssymb} (which includes amsfonts). The standard blackboard bold font has capital letters only, so \mathbb{r} or \mathbb{1} do not give a double-struck lowercase letter or digit in pdfLaTeX. For a double-struck 1 (indicator function) use a package such as bbm (\mathbbm{1}) or dsfont (\mathds{1}).

LaTeX
\usepackage{amssymb}
...
Let $x \in \mathbb{R}$ and $n \in \mathbb{N}$.

A shortcut for \mathbb{R}

\R is not a standard LaTeX command; some templates define it, most do not. Define your own in the preamble so the whole document stays consistent and you can switch to bold later in one place.

LaTeX
\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}

Typing ℝ directly

Pasting the Unicode character ℝ works with XeLaTeX or LuaLaTeX and the unicode-math package. With pdfLaTeX (Overleaf's default) it stops with "Unicode character ℝ (U+211D) not set up for use with LaTeX"; type \mathbb{R} instead.

Common mistakes

  • \R is undefined unless your template defines it ("Undefined control sequence").

    Instead of
    x \in \R
    Write
    x \in \mathbb{R}
  • Without the AMS fonts \mathbb is undefined in LaTeX, even though MathJax renders it.

    Instead of
    \mathbb{R}  (no amssymb loaded)
    Write
    \usepackage{amssymb}  % in the preamble
  • A plain R is an italic variable, not the set of real numbers.

    Instead of
    x \in R
    Write
    x \in \mathbb{R}
  • amssymb has no double-struck digits; use bbm or dsfont for an indicator 𝟙.

    Instead of
    \mathbb{1}_A
    Write
    \mathbbm{1}_A  % bbm package

In Overleaf, MathJax and Word

  • Overleaf and pdfLaTeX

    Add \usepackage{amssymb}. With the default pdfLaTeX compiler type \mathbb{R}, not the Unicode ℝ.

  • MathJax and KaTeX

    MathJax and KaTeX render \mathbb without any package. They also accept \mathbb{1}, which is one reason a formula can work on the web and fail in Overleaf.

  • Microsoft Word

    Word equations support double-struck letters. Write the formula in the editor on this page and use Copy for Word to paste ℝ as part of an editable Word equation.

Real number symbol ℝ in LaTeX: questions

What is the LaTeX command for the real numbers symbol?
\mathbb{R} in math mode, with the amssymb package loaded. It prints ℝ.
How do I write ℝⁿ or ℝ²?
Add a superscript to the set: \mathbb{R}^n, \mathbb{R}^2, or \mathbb{R}^{m \times n} for matrices.
How do I write the natural numbers and integers symbols?
Use \mathbb{N} for ℕ, \mathbb{Z} for ℤ, \mathbb{Q} for ℚ and \mathbb{C} for ℂ.
Why does \R give an error?
\R is not built in. Add \newcommand{\R}{\mathbb{R}} to the preamble, or type \mathbb{R} each time.
Should I use \mathbb{R} or \mathbf{R}?
Both are accepted conventions; blackboard bold is the most common today. Follow your journal's style and use the same one throughout.

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