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}Real numbers.
\mathbb{N}Natural numbers.
\mathbb{Z}Integers.
\mathbb{Q}Rational numbers.
\mathbb{C}Complex numbers.
\mathbb{R}^nn-dimensional real space.
\mathbb{R}_{>0}Positive reals;
\mathbb{R}^{+}is also common.\mathbf{R}Bold R, an older convention some journals still prefer.
\mathbb{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.
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.
A real function
LaTeXf : \mathbb{R} \to \mathbb{R}, \quad x \mapsto x^2Vector in ℝⁿ
LaTeX\mathbf{x} \in \mathbb{R}^nChain of number sets
LaTeX\mathbb{N} \subset \mathbb{Z} \subset \mathbb{Q} \subset \mathbb{R} \subset \mathbb{C}Non-negative reals
LaTeX\mathbb{R}_{\ge 0} = [0, \infty)Set-builder notation
LaTeX\{ x \in \mathbb{R} : x^2 < 2 \}Matrix space
LaTeXA \in \mathbb{R}^{m \times n}Expected value
LaTeX\mathbb{E}[X] = \int_{\mathbb{R}} x \, f(x) \, dx
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}).
\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.
\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
\Ris undefined unless your template defines it ("Undefined control sequence").Instead ofx \in \RWritex \in \mathbb{R}Without the AMS fonts
\mathbbis undefined in LaTeX, even though MathJax renders it.Instead of\mathbb{R} (no amssymb loaded)Write\usepackage{amssymb} % in the preambleA plain R is an italic variable, not the set of real numbers.
Instead ofx \in RWritex \in \mathbb{R}amssymb has no double-struck digits; use bbm or dsfont for an indicator 𝟙.
Instead of\mathbb{1}_AWrite\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
\mathbbwithout 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?
\Ris 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.
Related LaTeX reference
- Element of Symbol (∈) in LaTeX\in for ∈, \notin for ∉, \ni for ∋, and how ∈ differs from the Greek letter epsilon.
- Subset in LaTeX\subset, \subseteq, \subsetneq, the superset forms and the negated "not a subset" symbols.
- Indicator Function in LaTeXThe double-struck 1: why \mathbb{1} breaks in pdfLaTeX, \mathds{1} and \mathbbm{1} as fixes, and notation that also works on the web.
- 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