Free Programming Fonts

When your profession involves writing code for significantly long periods of time, even deceptively trivial things such as the font you’re using can make a huge difference.

This is a list of fonts for people who love code.

For your convenience, I have created a sample page for all the fonts mentioned here, which may help you choose the one that’s right for you.

Programming Fonts Sample Page

View source on GitHub

Selection Criteria

Here are the factors used for choosing the fonts in this list.

Monospaced

A good font that’s used for programming should be monospaced, meaning each character occupies the same amount of horizontal space1. Monospaced fonts are also called fixed-width fonts.

Using a fixed-width font is essential for formatting and readability of source code.

Screen readability and legibility

When you have to stare at code for hours, reading comfort is really important.

In addition, research shows that fonts can affect the user experience; typography has measurable cognitive effects on our mood2, which, in turn, could have indirect implications towards our productivity.

Preferably, the font we choose is explicitly designed with coding in mind, and is optimized especially for on-screen/computer-monitor readability.

Readability is a subjective matter — what’s easy for me to read, might not be so for you. The programming fonts sample page can be used as a rudimentary tool for evaluating the readability and legibility of each font in this list.

Unambiguous characters

To avoid syntax errors, we should be able to effortlessly distinguish between similar characters such as l, 1, | and I when we’re writing/reading code. Programmers shouldn’t have to wonder whether they typed 0, O or o, or whether a string value is wrapped with backticks (``) or apostrophes ('').

The sample page has a code block that contains potentially ambiguous characters so that you are able to test a particular font’s legibility.

Truly free

The best programming fonts are free and open-sourced in my opinion. And, particularly for those of us who are web developers, we’d like to not have to worry about whether or not we can render the font in the browser as part of a UI design.

My intention with this list is to highlight free fonts that are truly free. Some popular programming fonts — fonts that I also personally love, such as Consolas and Monaco — were intentionally left out because their licensing terms outside of personal use were unclear.

Reputation

A great deal of time was spent hunting down and researching the fonts for inclusion in this list. This activity led me to fonts that are well-loved by the programming community and helped me narrow this roundup down to a manageable size.

Personal preference

There’s always going to be some level of bias when pulling together a list like this.

There are many excellent programming fonts out there that match the criteria above, but at the end of the day this list has a major flaw and limiting factor: Me. I chose to include only the programming fonts I’m comfortable recommending to others. If you have recommendations, please share them in the comments section of this article.

The Fonts

You’ll find a table listing relevant resources and information for each font. Also, each font has multiple download links pointing to trustworthy domains in case a link stops working in the future.

1. Anonymous Pro

Anonymous Pro, by typeface designer Mark Simonson, was "designed especially for coders," according to its website. This font has keyboard characters like the Command key found on Apple keyboards, making it a good candidate font for displaying keyboard shortcuts on web pages and user interfaces.

Anonymous Pro resources
Official site Anonymous Pro
Useful resources Anonymous Pro specimen (PDF) (Mark Simonson)
Anonymous Pro: a programming font with style (Hivelogic)
Sites using Anonymous Pro (Typewolf)
License SIL Open Font License
Download links Mark Simonson
Font Squirrel
Google Fonts

2. Cousine

If you’re a fan of the Courier font family, then you’re going to like Cousine. Cousine improves on the font family that inspired it by offering "improved on-screen readability characteristics"3. This font was made by Steve Matteson, the designer of many of the fonts you see in open source operating systems.

Cousine resources
More info Cousine (Open Font Library)
License Apache License version 2.0
Download links Font Squirrel
Google Fonts

3. DejaVu Sans Mono

This monospaced font is a member of the DejaVu font family, an open source project. The font’s characters are markedly more robust compared to others in the same class.

DejaVu Sans Mono resources
Official site DejaVu Fonts
Useful resources DejaVu font specimen (PDF) (DejaVu Fonts)
Repo SourceForge.net
License Free license (custom)
Download links DejaVu Fonts
Font Squirrel

4. Droid Sans Mono

Part of the Droid font family, and commissioned by Google, this monospaced member promises "excellent legibility characteristics in its letterforms," according to its official description. This font functions well in code editors, but also looks good when rendered in user interfaces. Droid Sans Mono is also by Steve Matteson.

Droid Sans Mono resources
Official site Droid Sans Mono
Useful resources Droid Sans Mono great coding font (DamienG)
Font sample Droid Sans Mono (Wikipedia)
Repo GitHub
License Apache License version 2.0
Download links Font Squirrel
Google Fonts

5. Fira Mono

The Fira font family, designed by Erik Spiekermann, was commissioned by Mozilla for their OS. This monospaced variant has excellent punctuation-mark legibility for me.

Fira Mono resources
Official site Fira Sans on the designer’s website
Useful resources Mozilla Style Guide: Firefox OS Typeface (Mozilla)
Fira specimen page (Mozilla/Github.io)
Repo GitHub
License SIL Open Font License
Download links Carrois
Font Squirrel
Google Fonts

6. Hermit

Hermit is "a font for programmers, by a programmer." This font is a relatively new font. It’s by Pablo Caro, whose professional background as an engineer and computer scientist, and track record of projects, make him an individual not only qualified to know what the needs of programmers are, but also an interestingly atypical designer of fonts. This monospaced font is "designed to be clear, pragmatic and very readable," according to Caro’s website. "Its creation has been focused on programming."

Hermit resources
Official site Hermit
Repo GitHub
License SIL Open Font License
Download links Pablo Caro
GitHub

7. Inconsolata

Inconsolata draws inspiration from the ubiquitous Consolas font by Microsoft. Inconsolata was developed by Raph Levien, a Google engineer currently assigned to the Android platform. Levien says on his site that though there are many great programming fonts, many of them "do not have the attention to detail for high resolution rendering."

Inconsolata resources
Official site Inconsolata
License SIL Open Font License
Download links Levien.com
Font Squirrel
Google Fonts

8. Oxygen Mono

This monospaced font family is by Vernon Adams, a person who’s well-known in the open source font community. Oxygen Mono works well on the desktop. The font’s characters — and particularly, for me, its punctionation marks — have great definition and legibility.

Oxygen Mono resources
More info Oxygen Mono (Google Fonts)
Useful resources Very first drafts of ‘Oxygen Monospace’ (NewTypography)
Repo GitHub
License SIL Open Font License
Download links Font Squirrel
Google Fonts

9. PT Mono

The PT font family was designed for the Russian language, but works equally well with the Latin alphabet. The PT Mono variation is by Alexandra Korolkova. The font’s very readable, as well as very elegant with its Humanist characteristics.

PT Mono resources
Official site ParaType Public Types Project
License SIL Open Font License
Download links ParaType
Font Squirrel
Google Fonts

10. Source Code Pro

Source Code Pro created by Paul D. Hunt. This font is one of Adobe’s open source projects. Source Code Pro is comfortable to read and write code with.

Source Code Pro resources
Official site Source Code Pro
Repo GitHub
License SIL Open Font License
Download links Font Squirrel
Google Fonts

11. Luculent

Luculent is a font family designed for programmers. Several styles are included, which can help with syntax highlighting. Its development started in 2008, but it has only been recently released.

Luculent resources
Official site Luculent
License SIL Open Font License (OFL)
Download links Official Site

12. M+

M+ is a huge font family designed for the Japanese character set. Its fixed-width latin character variation is well-loved by many programmers.

M+ resources
Official site M+
Repo SourceForge Japan
License Custom free license
Download links Official site

13. Ubuntu Mono

The Ubuntu Font family was designed by Dalton Maag, a top font foundry. Its monospaced font is very clear and legible, and perfect for extended coding sessions.

Ubuntu Mono resources
Official site Unbuntu Font Family
License Ubuntu Font Licence
Download links Official site
Font Squirrel
Google Fonts

References

  1. Monospaced font (wikipedia.org)
  2. The Aesthetics of Reading (PDF) (mit.edu)
  3. Google Fonts Cousine (google.com)

Related Content

About the Author

Jacob Gube is the founder of Six Revisions. He’s a front-end web developer by profession. If you’d like to connect with him, head on over to the contact page or follow him on Twitter: @sixrevisions.