Licenses

The Best Free Monospace Fonts for Coding

· 3 min read

A monospace font gives every character the same width. That is the definition and it is also the least interesting thing about choosing one, because every font in this category does it. What separates them is a much narrower question: when you are tired and the code is dense, can you tell the characters apart?

There are three characters that decide it, and they are the same three every time.

Zero against capital O

The most common fix is a slash or a dot inside the zero. JetBrains Mono and Source Code Pro both do this. Some faces instead make the zero narrower or more oval than the O, which works but takes longer to learn. A face that does neither is not a coding font, whatever it says on the tin.

Lowercase l against capital I against the digit 1

This is the trio that produces the bug you stare at for twenty minutes. The good solutions are a tailed l, a serifed I, and a 1 with a full base. IBM Plex Mono gives the l a curved exit and the I proper crossbars, which makes the three of them unmistakable at any size.

Punctuation you can see

Braces, brackets and parentheses need to be distinct from each other at a glance, and the difference between a comma and a full stop and a semicolon has to survive at 12 pixels on a display you did not choose. This is where faces drawn for typography rather than for code tend to fall down: their punctuation is beautifully proportioned and far too small.

The families worth trying first

These are the ones that solve all three problems deliberately. Every one of them is free for commercial use, and the numbers below are read from the actual files rather than from a marketing page.

FamilyVariable downloadStatic download
JetBrains Mono187 KB2 files892 KB16 files
IBM Plex MonoNone published835 KB14 files
Source Code Pro211 KB2 files1017 KB16 files
Fira Code138 KB1 file481 KB5 files
Roboto Mono267 KB2 files789 KB14 files
Inconsolata186 KB1 file3.6 MB72 files
Six monospace families, measured from the font files in this archive.

JetBrains Mono was drawn specifically for reading code and has the tallest lowercase of the group, which is why it looks larger than other faces at the same point size. Fira Code is the one that popularised programming ligatures. IBM Plex Mono is warmer than most coding faces because it was drawn as part of a family rather than for terminals alone. Inconsolata is the oldest of them and still one of the most legible at small sizes.

Ligatures: a real decision, not a feature

Some of these faces draw a single arrow when you type a hyphen and a greater-than sign, or a proper not-equals when you type an exclamation mark and an equals. People are genuinely split on it. It makes operators easier to scan and it makes the characters you actually typed harder to count, which matters when you are debugging a regular expression.

It is worth knowing that this is a setting in your editor rather than a property of the font you are stuck with. Turning ligatures off in a face that has them gives you the plain characters back.

Monospace outside code

A monospace face is a strong editorial voice, not a neutral one. It reads as technical, documentary, provisional. That is useful for captions, data tables, tickets, timestamps and any interface where numbers change and you want the columns to stay still. It is tiring in a paragraph: the even spacing that keeps a column honest is exactly what makes a sentence feel typed rather than written.

How to actually choose

Do not choose from a specimen of the alphabet. Paste real code — your own, with your own bracket habits — into the preview box on a font page, set it to the size you actually work at, and read it. Then use it for a full day. The differences that matter are the ones that only show up over hours, and no amount of looking at ABCDEFG will surface them.

Every family here offers a WOFF2 download if you want it in a web-based editor, and the full monospace category has considerably more than the six above.

Questions

What is the best free monospace font for programming?
There is no single answer, but the shortlist is small: JetBrains Mono, IBM Plex Mono, Source Code Pro, Fira Code and Inconsolata all solve the characters that matter — a zero distinct from a capital O, and an l, I and 1 you can tell apart. Try one for a full working day rather than judging it from a specimen.
Should I use a coding font with ligatures?
It is a matter of taste and both positions are reasonable. Ligatures make operators quicker to scan and make it harder to see exactly which characters you typed, which matters when debugging something character-sensitive. It is an editor setting, so you can try it and turn it off without changing font.
Are these monospace fonts free for commercial use?
Yes. Every font on this site is under a licence permitting commercial use with no fee and no attribution requirement, mostly the SIL Open Font License. That covers using them in a terminal, in an app you sell, and on a website.
Why do monospace fonts look bigger than other fonts at the same size?
Usually because their lowercase letters are taller relative to the point size. Point size measures the whole design space rather than the letters, so two fonts set at 14 pixels can look noticeably different. It is not a bug and it is why comparing fonts means comparing them at the size you will use.

Fonts in this post

  • JetBrains Mono

    Monospace · Philipp Nurullin, Konstantin Bulenkov · Variable

  • Fira Code

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

  • Roboto Mono

    Monospace · Christian Robertson · Variable