Tx · LaTeX & TikZ

How to Typeset the Bitcoin Symbol in LaTeX

Published By the 9to5Science editorial team

At a glance

  1. 1. Choose an engine

    Use XeLaTeX or LuaLaTeX, which can use system fonts containing the Bitcoin sign.

  2. 2. Select a font

    Load a font with the U+20BF glyph, such as Noto Sans Symbols 2.

  3. 3. Define a command

    Print the sign with \symbol and wrap it in a reusable \bitcoin command.

  4. 4. Compile and check

    Compile with the chosen engine and verify that the font renders the character.

The Bitcoin sign is the Unicode character ₿, code point U+20BF. LaTeX does not provide a universal built-in command for it, so the reliable approach is to use a Unicode-capable engine and a font that contains the glyph.

The example below uses LuaLaTeX (XeLaTeX works too), the fontspec package, and Noto Sans Symbols 2. It defines \bitcoin so you can reuse the sign in your document.

Minimal working example

Save this as a .tex file and compile it with LuaLaTeX or XeLaTeX:

\documentclass{article}
\usepackage{fontspec}
\usepackage{amsmath}

\newfontfamily\bitcoinfont{Noto Sans Symbols 2}
\newcommand{\bitcoin}{{\bitcoinfont\symbol{"20BF}}}

\begin{document}
The Bitcoin sign: \bitcoin.

A price example: \text{\bitcoin} 0.05.
\end{document}

The fontspec package selects system fonts and requires XeLaTeX or LuaLaTeX; it does not work with pdfLaTeX. \newfontfamily declares a font-switching command for Noto Sans Symbols 2. The \symbol{"20BF} command prints the character at hexadecimal code point 20BF in that font. The braces in the definition keep the font change local to the symbol.

The example loads amsmath so \text{...} can place the sign in math mode. In ordinary text, write \bitcoin directly. If your TeX installation cannot find Noto Sans Symbols 2, install the font or change its name in the example to another installed font that includes U+20BF.

Using the character directly

With XeLaTeX or LuaLaTeX, you can also type or paste ₿ directly into the source file, provided the selected font supports it. If you want to control the font just for the sign, the \bitcoin command above is more dependable: the surrounding text can use a different font while the symbol uses the chosen one.

The sign may look slightly different across fonts. Check the compiled PDF rather than assuming that a font contains the glyph just because the source compiles; missing characters may appear as an empty box or another fallback symbol.

What about pdfLaTeX?

pdfLaTeX and its standard text fonts do not provide reliable, universal support for U+20BF. Adding an input-encoding declaration alone does not supply a missing glyph. If you must use pdfLaTeX, use a compatible symbol package or font if one is available for your setup, or include the sign as a vector or image graphic. For documents that need searchable, font-based Unicode text, switching to XeLaTeX or LuaLaTeX is usually simpler.

Common mistakes

  • Using \bitcoin without defining it: LaTeX will report an undefined control sequence unless a package or your own preamble defines that command.
  • Compiling with pdfLaTeX: fontspec requires XeLaTeX or LuaLaTeX. Select the engine in your editor or build command.
  • Assuming every font has the sign: U+20BF is a relatively recent Unicode character. Choose a font with the glyph and confirm the output in the PDF.
  • Putting a text glyph directly in math mode: Use \text{\bitcoin} in a formula, with amsmath loaded, rather than placing the text command unmodified in math mode.

References

  1. The Unicode Standard, Currency Symbols (U+20A0–U+20CF)
  2. The fontspec package

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.