Key takeaways >- A monospace font gives every glyph the same horizontal space. Google Fonts defines it as a typeface where “all or most characters take up the same amount of horizontal space.”- The whole design follows from one number: the cell width. Pick it before you draw a single letter.- Narrow letters (i,l,j,1) need slabs or tails to fill the cell. Wide letters (m,w,M,W) need compressed strokes to fit it.- For code, disambiguation beats beauty:0vsO,1vslvsI, andrnvsmmust never be confused.- Test in a terminal and an editor at 12 to 14 px, not in a specimen at 72 px.
This guide covers the decisions that separate a usable monospace font from a proportional font squeezed into a grid. It assumes you know the basics of a font editor. If you only need a monospace font for a project rather than to draw one, our best free monospace fonts roundup is the faster route.
Start with the cell, because every glyph inherits it
The cell width is the advance width every glyph shares. It sets how many characters fit on a line, how dense code looks, and how much room your widest and narrowest letters have to negotiate.
A common starting point is 0.6 em: 600 units on a 1,000-unit em square. Courier New uses almost exactly that ratio. Narrower cells (around 0.5 em) pack more code per line but force m and w into cramped shapes. Wider cells (0.65 em and up) relax the wide letters but leave i and l floating in empty space.
Work through it in this order:
- Set units per em (1,000 is the convention for PostScript-flavoured fonts; 2,048 for TrueType)
- Choose a cell width and apply it as the advance width of every glyph
- Set the x-height, cap height, ascender and descender
- Draw
n,o,m,iandHbefore anything else, since they span the full range from narrow to wide
Push the x-height up for small-size legibility
Code is read at small sizes, so the lowercase needs as many pixels as it can get. JetBrains describe their approach directly: “While characters remain standard in width, the height of the lowercase is maximized.” A taller x-height gives each letter more pixels at 13 px without changing how many characters fit on a line.
The trade-off is vertical rhythm. An extreme x-height shortens ascenders and descenders, which makes h vs n and p vs o harder to tell apart. Check both pairs at your target size before you commit.
Fill the cell with narrow glyphs
In a proportional font, i is a fraction of the width of m. In a monospace font they share one cell, so a plain vertical stem leaves a hole on both sides. Designers fill that space with structure:
iandl: add a slab at the top-left and a foot at the base, or curve the tail of thelto the rightj: extend the hook further left than you would in a proportional face1: give it a flag and a base serif, which also separates it fromlf,t,r: widen crossbars and terminals until they reach into the cell
The goal is even colour: a line of illi should look about as dark as a line of nnnn.
Compress wide glyphs without breaking them
The wide letters have the opposite problem. m has three stems where n has two, and it gets the same space. Common fixes:
m: shorten the middle stem so it doesn't reach the baseline, or thin all three stems slightlywandW: raise the crossing point of the inner strokes, or let the middle vertex stop below the cap heightM: splay the outer stems less and drop the middle vertex higher
Thin the strokes by a few units rather than all at once. If m looks visibly lighter than n in a paragraph of code, you've gone too far.
Design for disambiguation before style
Programmers read character by character. A monospace font for code fails if two glyphs can be confused. Check these pairs in every weight:
Pair | Common fix |
|---|---|
| Slashed or dotted zero; make |
| Flag on |
| Keep the gap between |
| Distinct terminals and angles |
| A comma tail long enough to read at small sizes |
| Visible corners on braces |
If you ship a slashed or dotted zero as an alternate rather than the default, expose it through the zero OpenType feature so editors can turn it on.
Size punctuation and operators for code
Punctuation in a text font is small because it sits between words. In code, ;, :, =, <, >, - and _ carry meaning, so draw them larger and centre them in the cell. Align the horizontal strokes of -, +, = and ~ to the same height so expressions like a = b + c - d read as one level.
Box-drawing characters (│, ─, ┌ and the rest of the U+2500 block) have a stricter rule: they must reach the edges of the cell and the full line height, so that lines connect across characters in terminal interfaces.
Decide on ligatures, and ship a version without them
Coding ligatures merge sequences like ->, != and >= into single-looking glyphs while keeping each character in its own cell. JetBrains frame them as a way to “reduce noise by merging symbols.” They are also divisive: some developers find they hide what is typed.
If you add them, keep each ligature exactly as wide as the characters it replaces, and publish a no-ligatures build. JetBrains ship JetBrains Mono NL for exactly this reason: editors without OpenType support, and readers who prefer the raw characters.
Turn kerning off and trust the grid
Kerning adjusts space between specific pairs. In a monospace font it breaks the one promise the font makes, which is that column 40 is column 40 on every line. Leave the kern table empty, and check that no glyph's advance width has drifted from the cell during editing. A single stray value will misalign every line it appears in.
Draw italics and weights with the same cell
Every weight and the italic must share the cell width, or switching weights in an editor will reflow code. JetBrains Mono ships eight weights from Thin to ExtraBold, each with an italic, all on one grid.
A variable font can hold the weight range in one file. Google Fonts also documents a separate monospace axis (MONO) that some families use to move between proportional and monospaced widths. Our variable fonts guide covers how the axes work.
Pick tools that enforce one advance width
Any serious font editor can build a monospace font. What matters is whether it lets you set and audit one advance width in one step across hundreds of glyphs:
- FontForge: free and open source, with metrics tools to set widths across a selection
- Glyphs: paid, macOS only, with strong batch editing of metrics
- Fontra: an open-source, browser-based editor
Whatever you use, script a final check that lists every glyph whose advance width differs from the cell. Run it before every export.
Test in real code at real sizes
A specimen sheet at 72 px hides every problem that matters. Test the way the font will be used:
- Set it as the font in a code editor at 12, 13 and 14 px
- Open real files in three languages with different symbol density (for example JSON, Python and a shell script)
- Run a terminal session with box-drawing output
- Check both dark and light themes, since weight reads differently on each
- Compare against the font you currently use for a full day of work
On the web, remember that CSS ui-monospace resolves to the operating system's monospace font and is only supported in Safari. We cover that in what ui-monospace actually is.
Choose a license before you publish
If you plan to release the font, the license decides whether others can embed, modify or redistribute it. JetBrains Mono uses the SIL Open Font License 1.1, which allows free commercial and non-commercial use. Our font licensing guide explains the differences between desktop, web and app licenses.
Frequently asked questions
What width should a monospace font be? Around 0.6 em (600 units on a 1,000-unit em) is a common starting point and close to the ratio Courier New uses. Narrower cells fit more code per line but cramp m and w; wider cells relax them but leave narrow letters floating.
Can I convert a proportional font into a monospace font? Not by changing advance widths alone. Narrow and wide letters need redrawing, or the result has uneven colour and letters that look stranded in their cells.
Should a coding font have ligatures? It's a preference. If you include them, ship a no-ligatures version too, as JetBrains does with JetBrains Mono NL.
What is the most important test for a coding font? Disambiguation at small sizes: 0 vs O, 1 vs l vs I, and rn vs m at 12 to 14 px in a real editor.
Last updated: 13 September 2026.
Sources: Google Fonts Knowledge, “Monospaced” and “Monospace axis”, accessed 13 September 2026 · JetBrains Mono repository, accessed 13 September 2026




