Which font is used on Stack Overflow for code snippets?


var $div = $("#preloader");
$.each($.imgNames, function (i, val) {
    $("<img />").attr("src", $.largePath + val).addClass('PRELOADED').appendTo($div);

2 Answers 2


It depends what fonts are available on your system, but the list (in order of priority) is:

Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif

You can see this by inspecting one of the pre or code elements that contain formatted code (screenshot from Chrome's DOM inspector):

enter image description here

For more information on how that CSS behaves, you could look at the CSS Fonts module specification.


As of May 10, 2021 the font Stack Overflow, Inc. uses on Stack Overflow/Stack Exchange is as follows:

OS Sans Mono
macOS San Francisco San Francisco Mono
iOS San Francisco San Francisco Mono
Windows Segoe UI Consolas, or Cascadia Mono, Segoe UI Mono if you've installed those manually
Ubuntu Ubuntu Ubuntu Mono
Android Roboto Roboto Mono
Chrome OS Roboto Roboto Mono
Fallback sans-serif Menlo, Monaco, Consolas, monospace

From We are switching to system fonts on May 10, 2021

Not the answer you're looking for? Browse other questions tagged .