The basics
What is an OTF file?
An OTF file holds one font: the shapes of its letters, digits and symbols, their spacing, the font's names and licence, and often a set of typographic features such as ligatures, small caps and alternative figures. You install it to use the font in your apps, the same way as a TTF.
OpenType was announced in 1996 by Microsoft and Adobe as a way to end the split between TrueType fonts and Adobe's PostScript Type 1 fonts. It kept TrueType's file structure, a directory of tables, and allowed the outlines to be either TrueType curves or PostScript curves in a compact form called CFF. It also added the GSUB and GPOS tables for advanced typography and for scripts such as Arabic and the Indic scripts.
By convention, .otf means an OpenType font with CFF (PostScript) outlines and .ttf one with TrueType outlines. Both are OpenType fonts, and the extension isn't binding: our sample-truetype-outlines.otf is a valid .otf file with TrueType outlines inside.
Anatomy
What's inside an OTF file
An OTF file has the same layout as a TTF: a header, a directory of tables, then the tables. The difference is the outline table. Below is our sample-regular.otf. Numbers are big-endian: 00 00 0B 20 is 0xB20, which is 2,848.
offset bytes meaning
000000 4F 54 54 4F version "OTTO": CFF outlines
000004 00 09 9 tables
000006 00 80 00 03 00 10 search helpers
table directory, 16 bytes per table:
tag checksum offset length
00000C 43 46 46 20 1F FA AE 2B 00 00 0B 20 00 00 22 E0 CFF
00001C 4F 53 2F 32 … OS/2
00002C 63 6D 61 70 … cmap
00003C 68 65 61 64 … head
00004C 68 68 65 61 … hhea
00005C 68 6D 74 78 … hmtx
00006C 6D 61 78 70 00 63 50 00 00 00 00 F8 00 00 00 06 maxp
00007C 6E 61 6D 65 … name
00008C 70 6F 73 74 … post
the CFF table:
000B20 01 00 04 02 CFF header, version 1.0
000B24 00 01 01 01 18 one font name, 23 bytes
000B29 39 39 68 65 6C 70 65 72 73 53 61 6D 70 6C 65 … "99helpersSample-Regular"
… Top DICT, strings, charset, charstrings
the glyph "o" as a charstring, decoded:
593 474 66 rmoveto width, first point
49 51 25 61 72 vvcurveto a cubic curve
72 -25 61 -49 51 vhcurveto another one
… 8 curves per contour, 2 contours, endchar
002F8C end of file: 12,172 bytes- 1
4F 54 54 4FThe version tag
The ASCII letters
OTTO, meaning the outlines are in aCFForCFF2table. A TrueType-flavoured font has00 01 00 00here, whatever its extension. - 2
00 09Nine tables
One fewer than the TTF version of the same font: the
CFFtable replaces bothglyfandloca, because it has its own index of where each glyph starts. - 3
43 46 46 20 1F FA AE 2B 00 00 0B 20 00 00 22 E0The CFF entry
The tag is
CFFplus a space (tags are always four bytes), then a checksum, the offset 0xB20 and the length, 8,928 bytes. - 4
6D 61 78 70 … 00 00 00 06A shorter maxp
In a CFF font,
maxpis version 0.5: just 6 bytes with the glyph count. The extra fields a TrueType font needs for its hinting engine are left out. - 5
01 00 04 02The CFF header
Compact Font Format version 1.0. CFF is Adobe's compact repackaging of PostScript Type 1 font data, and is a complete font format of its own, nested inside the OpenType wrapper.
- 6
00 01 01 01 18 / 39 39 68 65 …The Name INDEX
A list with one entry (
00 01), one-byte offsets, and a name 23 bytes long: the PostScript name99helpersSample-Regular, which printers and PDF files use to refer to the font. - 7
593 474 66 rmovetoA charstring
Each glyph is a tiny program in the Type 2 charstring language: numbers followed by operators, stored compactly as bytes. The first number is the glyph's advance width, then it moves to the first point of the o.
- 8
49 51 25 61 72 vvcurvetoCubic curves
Curve operators take the control points of cubic Bézier curves, as relative moves.
vvcurvetois a shortcut for a curve that starts and ends vertically, which saves bytes.
Under the hood
How an OTF font works: CFF outlines
Most tables in an OTF are the same as in a TTF: cmap maps characters to glyphs, hmtx gives widths, name the names and licence, OS/2 weight, line spacing and embedding permissions. What differs is how the outlines are stored:
- Cubic curves. CFF glyphs are drawn with cubic Bézier curves, each with two control points: the same kind of curve as in PostScript, PDF, SVG paths and design apps such as Illustrator. Type designers often draw in cubics, so CFF fonts keep their drawings as they were made.
- Charstrings. Each glyph is a short program of numbers and drawing operators (Type 2 charstrings). Pieces shared by many glyphs can be stored once as subroutines and called from each glyph, which keeps large fonts compact.
- Hints, not instructions. CFF fonts carry hints: where the stems are, and alignment zones such as the baseline and x-height. The rasteriser decides how to fit them to the pixel grid. TrueType instead stores the fitting as programs inside the font. CFF hinting is far less work for the font maker; TrueType hinting gives more control on low-resolution screens.
- CFF2. Added in OpenType 1.8 (2016), CFF2 is a leaner version of CFF that also supports variable fonts. It drops some PostScript leftovers, such as the font's own copy of its names.
Converting between outline types
Quadratic TrueType curves can always be turned into cubic CFF curves exactly. The other way round is an approximation: each cubic curve becomes one or more quadratic curves within a small tolerance, so a font converted from OTF to TTF usually has more points and loses its CFF hints.
Typography
OpenType features: ligatures, small caps and figures
OpenType features are rules inside the font that swap or reposition glyphs. GSUB substitutes glyphs (fi becomes the fi ligature, a letter becomes its small capital), and GPOS positions them (kerning, mark placement for accents). Each feature has a four-letter tag. Some are on by default; others an app or a stylesheet has to switch on.
| Tag | Feature | Usually |
|---|---|---|
kern | Kerning: adjusts space between pairs such as AV | On |
liga | Standard ligatures such as fi and fl | On |
smcp | Small capitals | Off |
onum / lnum | Old-style or lining figures | Off; the font's default applies |
tnum / pnum | Tabular (equal-width) or proportional figures | Off; the font's default applies |
ss01…ss20 | Stylistic sets: alternative letter shapes | Off |
/* Turn OpenType features on with CSS */
.figures { font-variant-numeric: tabular-nums; } /* tnum */
.smallcap { font-variant-caps: small-caps; } /* smcp */
.oldstyle { font-feature-settings: "onum" 1; } /* low-level switch */
.nolig { font-variant-ligatures: none; } /* liga off */Features work the same in TTF and OTF files: they live in the GSUB and GPOS tables, not in the outlines. Our samples keep things simple and have none; their digits are tabular by design.
Related formats
OTF vs TTF vs WOFF2
| OTF (CFF) | TTF | WOFF2 | |
|---|---|---|---|
| Outlines | Cubic curves (CFF or CFF2) | Quadratic curves (glyf) | Either: it wraps a TTF or OTF |
| First four bytes | OTTO | 00 01 00 00 | wOF2 |
| Hinting | Stem and zone hints | Instructions in the font | Same as the font inside |
| OpenType features | Yes | Yes | Yes, whatever the font has |
| Variable fonts | Yes, with CFF2; less widely supported | Yes, the common choice | Yes |
| Our regular sample | 12,172 bytes | 11,588 bytes | 4,428 bytes |
For installing on a computer, use whichever the font maker supplies: in current apps, neither is better. Some foundries recommend OTF for print and design work and TTF for Windows screen use, because of the hinting difference. For a website, convert either to WOFF2.
Variants
Variable OTF fonts and CFF2
A variable OTF stores its outlines in a CFF2 table, with blend operators that say how each coordinate changes along a design axis. Our sample-variable-cff2.otf covers weights 300 to 700 with five named styles, using the same fvar, HVAR and STAT tables as a variable TTF.
Browsers and current macOS and Windows versions render CFF2 fonts, but support in apps, older systems and some PDF tools is patchier than for variable TTFs. That's why most variable fonts, including those on Google Fonts, are distributed with TrueType outlines.
How to
How to install, open and convert an OTF file
- Windows: double-click the file to preview it, then click Install (or right-click, Install for all users).
- macOS: double-click to open it in Font Book and click Install.
- Linux: copy it to
~/.local/share/fontsand runfc-cache -f. - On a website: convert it to WOFF2 (fontTools, or FontForge) and load it with
@font-face. Browsers accept raw OTF files too, but they're larger. - Convert to TTF: FontForge or fontTools (
otf2ttfin its snippets, which uses cu2qu) convert CFF outlines to quadratic ones. Expect more points and the loss of CFF hints. - Inspect it:
ttx -l font.otflists the tables, andttx -t CFF font.otfdumps the outlines as readable charstrings.
Troubleshooting
Common problems with OTF fonts
- Features don't appear. The app has to support OpenType features and expose them. Design apps usually do; office apps support only some. In CSS, use
font-variant-*orfont-feature-settings. - The font isn't in the menu after installing. Restart the app, which reads the font list at start-up.
- Thin or soft text on Windows at small sizes. CFF hints leave more to the rasteriser, and some older Windows apps rendered CFF fonts less crisply than well-hinted TrueType. At larger sizes and on high-resolution screens the difference disappears.
- Can't embed in a PDF or document. The font's
fsTypeembedding flags, or the app's settings, may forbid it. Check the licence and the font's properties. - A converter gives a broken TTF. Cubic-to-quadratic conversion is approximate and can produce overlapping or reversed contours. Use fontTools or FontForge and check the result in a font validator.
Free downloads
Sample OTF files to download
Free sample OTF fonts for testing font installers, renderers, converters and @font-face set-ups. They use 99helpers Sample, an original geometric typeface we drew for these pages, with Latin letters, digits, common punctuation and a few accented letters.
Aa Gg 99
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789 .,:;!?&@#()
14pxThe quick brown fox jumps over the lazy dog
20pxThe quick brown fox jumps over the lazy dog
32pxThe quick brown fox jumps over the lazy dog
48pxThe quick brown fox jumps over the lazy dog
What's inside sample-regular.otf
The regular weight with CFF outlines, built with fontTools. The specimen above is drawn with this exact file.
Nine tables
CFF,OS/2,cmap,head,hhea,hmtx,maxp,nameandpost: noglyforloca, since the CFF table holds the outlines.Cubic outlines
Every glyph as a Type 2 charstring with cubic curves. The design is the same monoline geometric sans as the TTF; only the curve type differs.
99 glyphs
A to Z, a to z, 0 to 9, space,
.,:;!?&@#()-'"/, á à â ä é è ê ë í ï ó ô ö ú ü ñ É Ü Ñ, plus.notdefand a dotless i.Names
Family
99helpers Sample, styleRegular, PostScript name99helpersSample-Regular, weight class 400.Licence
In the
nametable and in the CFFNoticestring, with a link back to this page.fsTypeis 0: installable embedding.
All sample OTF files
Regular weight, CFF outlines
sample-regular.otf · 11.9 KB (12,172 bytes)
99helpers Sample Regular (weight 400) as an OpenType font with a
CFFtable: 99 glyphs, cubic curves, no hints.- Testing font installation and CFF rendering
- A source file for OTF to WOFF2 or TTF conversion
Bold weight, CFF outlines
sample-bold.otf · 12.0 KB (12,256 bytes)
The same family at weight 700, with the bold style bits set so apps pair it with the regular file.
- Testing style linking in apps
- Comparing real and synthetic bold
Variable font with CFF2 outlines
sample-variable-cff2.otf · 26.3 KB (26,952 bytes)
A variable OpenType font with a
CFF2table and onewghtaxis from 300 to 700, with five named styles (Light to Bold).- Testing CFF2 and variable-font support
- Checking which apps and PDF tools handle CFF2
OTF file with TrueType outlines
sample-truetype-outlines.otf · 11.3 KB (11,588 bytes)
A valid
.otffile that starts with00 01 00 00and stores its outlines inglyf, like a TTF. Tests code that guesses the outline type from the extension.- Testing format detection by signature, not by name
- Checking upload filters and converters
Ways to test with them
- Rendering: install
sample-regular.otfand compare it withsample-regular.ttffrom the TTF page at small sizes; any difference comes from the outline type and rasteriser. - Format detection: a tool should report
sample-truetype-outlines.otfas TrueType-flavoured, because its first four bytes are00 01 00 00, notOTTO. - Variable fonts: open
sample-variable-cff2.otfin an app with variable-font support and move the weight slider; if nothing happens, the app doesn't support CFF2. - Converters: convert
sample-regular.otfto TTF and compare point counts withttx; quadratic outlines need more points.
Free to use for testing, teaching and demos, commercially or not, with no attribution needed. A link back to this page is always appreciated.
Put it online
Have an OTF file? Give it a link.
Drop an OTF file on 99helpers and it gets its own address in seconds. Opening the link downloads the font, since browsers don't display font files on their own, and a page or site you host on 99helpers can load it with @font-face.
Questions
OTF files, frequently asked
What is an OTF file?
An OpenType font, usually one with PostScript-style (CFF) outlines. You install it like any font to use it in your apps.
How do I install an OTF font?
On Windows, double-click it and click Install. On macOS, double-click it and click Install in Font Book. On Linux, copy it to ~/.local/share/fonts and run fc-cache -f.
Is OTF better than TTF?
Neither is better in current apps. OTF usually has cubic CFF outlines and simpler hints; TTF has quadratic outlines and can carry detailed hinting. Both support the same OpenType features.
Can I use an OTF font on a website?
Yes, browsers accept OTF in @font-face, but converting it to WOFF2 makes it much smaller. Check that the licence allows web use.
How do I convert OTF to TTF?
With FontForge or fontTools. The curves are converted from cubic to quadratic, which is a close approximation, and CFF hints are lost.
What is the MIME type of an OTF file?
font/otf, registered in RFC 8081 in 2017. It covers OpenType fonts with either kind of outlines.
Why don't ligatures or small caps show up?
Your app has to support OpenType features and you may have to switch them on. Some features, like small caps, are off by default; check the font includes them too.
Related formats
Other file types explained
Keep going
Related
Sources
- Microsoft: OpenType font file (table directory)
- Microsoft: OS/2 table (fsType, usWeightClass)
- RFC 8081: The font top-level media type
- MDN: @font-face src
- Microsoft: CFF2 table
Last reviewed 27 October 2026.