Free Programming Fonts

Jul 28 2014 by Jacob Gube | 15 Comments

When your profession involves writing code for significantly long periods of time, even deceptively trivial things such 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.

15 Comments

Tony

July 28th, 2014

I would add Ubuntu Mono. It’s the most readable to my eye. https://www.google.com/fonts/specimen/Ubuntu+Mono

Bill Woodward

July 28th, 2014

Meslo is another good one.

https://github.com/andreberg/Meslo-Font

Luke Pettway

July 28th, 2014

Awesome! I wrote an article recently about this very subject. I never considered changing fonts in IDE’s but it really makes a difference and adds a personal touch to what you see on the screen.

I’m using Anonymous Pro at the moment, but I’ll check out what you are using as well!

Anwar Choukah

July 28th, 2014

I recommend “M+ 1m” – http://fontsquirrel.com/fonts/M-1m — it’s a lovely-looking font, different from others by being condensed and very legible. My bad eyes love it! Looks beautiful light on dark…

Raymond

July 28th, 2014

I love Inconsolata. I’ve been using it in Sublimetext 3, and as my terminal font on Ubuntu for quite awhile now.

Anwar Choukah

July 28th, 2014

Regarding M+ 1m – here’s the official download link: http://mplus-fonts.sourceforge.jp/mplus-outline-fonts/download/index-en.html

It contains some weird font-formats I’ve never heard of, (.bdf and .diff)… Sorry, I’m not a programmer and my Mac had no clue what to do with them.. Luckily, after a short search on, I found it on Fontsqurrel,

sunil

July 28th, 2014

Source Code Pro is the best.

It’s beautiful in emacs, and probably anything else.

For some reason, using in jetbrains editors is difficult, and I haven’t been able to figure out how to get phpstorm to render them. I have no idea why this is the case.

But it’s a great font for working with when you are looking at code all day.

David B. Wildgoose

July 29th, 2014

My personal favourite is Bitstream Vera Sans – to be honest I was surprised not to see it here. I really liked the DejaVu font though, which looked extremely similar. So similar in fact, that I investigated. It appears to be a superset that is expanding on Bitstream Vera! :-)

james niko

July 29th, 2014

I think DejaVu and Source code pro fonts are the one s that I like very much.

Jacob Gube

July 29th, 2014

Firstly, I’d like to thank everyone who has provided me with feedback about this list; it’s all been very helpful!

Having been afforded the chance and time to review the original work and demo page after a day away from it, as well as the helpful feedback I’ve gotten here on the site, through email, on GitHub, and other channels of communication, I’d love to issue an update in the next few days that improves this list of programming fonts.

Here are things I’m thinking of doing/fixing:

Go beyond the 10 fonts: One of the biggest lessons I’ve learned from you is that there are so many great fonts that meet the selection criteria that it would be a good idea to go beyond the original arbitrary limit of ten fonts. I’d like to expand this list based on your suggestions, and I already have a few excellent fonts in mind.

Improve readability of the sample page: All these fonts look great when viewed in desktop software (e.g. in a code editor), as well as in retina displays. But when I’m looking at the sample page on, for example, Chrome for the desktop (in mobile Chrome, they all look great to me) + my desktop monitor, some of the fonts aren’t rendered in a way that truly represents their aesthetic and legibility qualities; particularly, for example, Hermit and Fira Mono. I’ll try to see if I can replace their web font files so that they render as best as possible in as many viewing situations as possible. Also, I’ll be improving the color contrast. For instance, there’s poor definition between the comments syntax highlighting versus the highlighting of object names, expressions and methods, as well as versus the light-gray background color.

Truly and sincerely, I want to thank you for helping. I know it takes time and effort to provide feedback, so I value your suggestions. I’ll post an update here and on Twitter when I’ve pushed out the new version of the list/demo page.

Jacob Gube

July 29th, 2014

@Anwar Choukah: Thank you! I’ve gotten a ton of feedback about M+. I’ll be updating this list with it.
@David B. Wildgoose: DejaVu is an expansion of Bitstream Vera fonts (which had a limited character set), with their changes to the Bitstream Vera being released as public domain work. I felt including both would be redundant, so I chose to include the family that was more comprehensive. Thoughts?

RoseHosting

July 30th, 2014

My favorite monospace font is Envy Code R. I’ve been using it as my primary terminal font for a couple of years now.

Anwar Choukah

July 30th, 2014

@Jacob Gube :) I saw it here first (probably like most others) — http://www.macwright.org/2014/07/09/mplus.html

Jacob Gube

July 31st, 2014

@Anwar Choukah: Looks really nice with JS! :) Thanks for sharing that link with me! I’ll add that to its info table when this post is updated.

Rob

August 15th, 2014

Anonymous looks pretty darn good. Didn’t know that one.

Leave a Comment

Subscribe to the comments on this article.