Best Fonts for Programmers: A Biased and Practical Guide
I put this list together for your curiosity and perhaps your enjoyment. If you spend hours a day staring at a wall of code, you’ve probably wondered at some point: Is there a better font out there?
Most developers never actively choose their font. It’s usually whatever their IDE or OS sets by default. And while those defaults might seem “good enough,” there’s almost always something cleaner, clearer, or simply more pleasant to look at for long stretches of time.
What’s a Good Font?
Not all fonts are created equal. When choosing a programming font, I focus on a few key characteristics.
Monospace. This means that every character takes the same amount of space. In my opinion, it’s essential for readability. Clean indentation, aligned code blocks, predictable visual flow. It’s non-negotiable.
Clarity. Can you quickly see the difference between the letter O and the number 0? What about a lowercase l, and a capital I? If it’s too confusing, move to the next one.
Comfort and Consistency. Line height and weight should support clear reading. I don’t want weird variations of thickness, or anything that becomes too noisy. The goal is always effortless readability. An optional element that I am looking for is ligatures. I know that some people don’t like it, because it can break readability. Can you see the difference between two or three equal signs? In some languages, it matters.
There’s no objective “best” font, but there will be a best font for you. You can also include some other criteria:
- Editor support
- Display quality
- How does it look with syntax-heavy languages?
If you want to get a preview of a font, here is a website for that: Programming Fonts.
A Biased Ranking
In general, all of the fonts above are solid choices and will serve most developers very well. That said, I’ve ranked them to give a clearer recommendation for anyone who wants a straightforward answer:
- JetBrains Mono: Clean, balanced, and free; purpose-built for developers with great readability and ligature support
- Berkeley: A premium font with elegance and clarity; stylish without sacrificing practicality
- Iosevka: Ultra-customizable and dense; perfect for code minimalists and font nerds who like control
The only reason JetBrains Mono ranks above Berkeley is its price. JetBrains Mono is free, whereas Berkeley is the only paid font mentioned here. All the fonts in this top three give a strong balance between comfort and clarity, both with light and dark themes.
The following fonts also meet the same criteria, but didn’t make it into my personal top three. Still, they’re all excellent and perfectly usable.
- Fira Code
- Julia Mono
- SourceCode Pro
- Cascadia Code
- Hack
- Monaspace
- Monaco
- IBM Plex Mono
- Operator Mono
- PragmataPro
Some people enjoy using a font for their IDE, and another one for their terminal. In my case, I use the same fonts across both my IDEs and terminal. It keeps things consistent and comfortable.
Typeface Customization
You may want to customize your fonts to improve their looks. For example, you may want a slightly heavier weight for better contrast on a high-resolution monitor. You may want tighter letter spacing to fit more code. A font without ligatures, or with very specific ones…
To do this, you’ll need a font that supports customization. All fonts are not as permissive in terms of customization. For example, Iosevka is a really flexible typeface built from a configuration file that lets you adjust a lot of parameters.
To customize things like weight, width, or slant, look for the variable font version of a typeface, and use either an ad hoc toolchain, or a tool like FontDrop! to inspect or adjust variables. For deeper customization, you can build fonts like Iosevka from source or edit them with a font editor like Font Forge, or Glyphs.
Anyway, this level of customization will take some time, and can be frustrating, but it pays off if you’re picky or sensitive to visual noise.
Personally, I stick with JetBrains Mono most of the time. That said, Berkeley and Iosevka are right behind. If you care about aesthetics (and I think you should), try a few fonts and find the best one for you.