Programming Ligatures: What They Are and How to Turn Them On

· 3 min read

Open a file in a coding font like Fira Code and some pairs of characters stop looking like pairs. Two equals signs become one long bar, an exclamation mark and an equals sign become a proper not-equal sign, and an arrow typed as a hyphen and a bracket turns into a real arrow. These are programming ligatures, and they divide developers roughly down the middle.

What a programming ligature actually is

A ligature is two or more characters drawn as one shape. Printers have used them for centuries — the fi in a book is usually a single piece of type, because the dot of the i would otherwise collide with the hood of the f. Programming ligatures borrow the idea for operators: the font notices a sequence like != or === and swaps in a glyph drawn to read as one symbol.

The important detail is that nothing in the file changes. The characters on disk are still an exclamation mark and an equals sign. Copy the line into another program and the ligature is gone. The font is only changing how the text is painted, which is why switching it off is a display setting and not a code change.

In a monospaced font the merged glyph still takes up exactly the width of the characters it replaces — two cells for a two-character operator. Columns stay aligned, and the cursor still moves through the pair one character at a time.

The fonts in this archive that have them

Fira Code is where most people meet the idea: it took Mozilla’s Fira Mono and added a large ligature set. JetBrains Mono is the default in JetBrains’ IDEs and draws its ligatures more conservatively. Cascadia Code is Microsoft’s, made for Windows Terminal. Victor Mono combines ligatures with a cursive italic that makes comments look handwritten. The whole group is on the ligatures style page.

Victor Monovariable

Sphinx of black quartz, judge my vow

In the static download

400 is one of the 7 weights the static download ships as its own file.

Victor Mono, drawn from the real font file. Try the weight — coding fonts are often more comfortable a step lighter or heavier than Regular.

Turning them on in your editor

Installing the font is not enough; most editors ship with ligatures off. The switch is one line or one tick box.

  • VS Code: set editor.fontFamily to the font’s name and editor.fontLigatures to true in your settings.
  • JetBrains IDEs: Settings, then Editor, then Font, and tick Enable ligatures.
  • Terminals: support varies. Windows Terminal and iTerm2 draw them; some fast GPU terminals deliberately do not. If a terminal shows the characters separately, the font is fine and the terminal is the limit.

On a web page, programming ligatures are usually built from the contextual alternates feature, not the standard ligature one. That catches people out: font-variant-ligatures: none may not remove them, and font-feature-settings: "calt" 0 will. If you are showing code samples on a site, see how to self-host a font first.

The case against, which is not nothing

The objection is that ligatures hide what you typed. A merged not-equal sign looks like the mathematical symbol, and in some languages the two-character operator and a single Unicode symbol mean different things. When reading someone else’s code, or teaching, the literal characters can matter more than the prettiness. There is also the plain matter of taste: some people find the merged shapes distracting.

That is why the choice belongs to the reader and not the font. Every one of these families works perfectly well with the feature switched off, and our list of the best free monospace fonts covers the ones without ligatures too.

FamilyVariable downloadStatic download
Fira Code138 KB1 file481 KB5 files
JetBrains Mono187 KB2 files892 KB16 files
Cascadia Code522 KB2 files2.0 MB12 files
Victor Mono198 KB2 files936 KB14 files
Download sizes, measured from the files in this archive.

Questions

Do programming ligatures change my code?
No. The characters saved in the file are exactly what you typed. The font only changes how certain sequences are drawn on screen, so copying the code elsewhere, or opening it in another editor, shows the original characters.
Why are ligatures not showing in VS Code?
Because they are off by default. Set editor.fontLigatures to true in your settings, and make sure editor.fontFamily names a font that has them, such as Fira Code, JetBrains Mono, Cascadia Code or Victor Mono.
Which free coding fonts have ligatures?
Fira Code, JetBrains Mono, Cascadia Code and Victor Mono all carry programming ligatures and are free under the Open Font License, including for commercial use.
What is the difference between Cascadia Code and Cascadia Mono?
They are the same design. Cascadia Code includes programming ligatures and Cascadia Mono does not, so Mono is the one to use if you prefer to see every character separately.

Fonts in this post

  • Fira Code

    Monospace · The Mozilla Foundation, Telefonica S.A., Nikita Prokopov · Variable

  • JetBrains Mono

    Monospace · Philipp Nurullin, Konstantin Bulenkov · Variable

  • Cascadia Code

    Monospace · Aaron Bell, Mohamad Dakak, Viktoriya Grabowska, Liron Lavi Turkenich · Variable

Put it to work

Find the font for your next project.

All 337 families here are free for commercial use, and every download carries its license inside the zip.

Browse all 337 fonts