File types · Explainer

The TTF file (.ttf)

A TTF file is a TrueType font: a set of letter shapes, spacing and names that computers use to draw text on screen and in print. This guide explains what's inside one, how it differs from OTF and web fonts, the quirks worth knowing, and has free sample TTF files to download for testing.

At a glance

Full name
TrueType font
Extensions
.ttf; font collections use .ttc
MIME type
font/ttf (RFC 8081, 2017); application/x-font-ttf and application/font-sfnt are older, unofficial ones
Kind
Binary; a directory of tables, with outlines drawn from straight lines and quadratic curves
Standard or owner
Created by Apple; now part of the OpenType specification (Microsoft) and ISO/IEC 14496-22 (Open Font Format)
First released
1991, by Apple in Mac System 7; Microsoft added it in Windows 3.1 (1992)
Opens with
Windows Font Viewer, macOS Font Book, Linux font managers, any browser through @font-face, font editors such as FontForge and Glyphs
Limits
Up to 65,535 glyphs per font
Magic number
00 01 00 00; some old Mac fonts use 74 72 75 65 (true)

The basics

What is a TTF file?

A TTF file holds one font: the outline of every letter, digit and symbol it covers, how wide each one is, how far apart lines sit, which character each shape belongs to, and the font's name and licence. Operating systems, word processors, design apps and browsers use those outlines to draw text at any size, on screen or on paper.

Apple developed TrueType in the late 1980s as an alternative to Adobe's PostScript Type 1 fonts, and released it in 1991. Microsoft licensed it for Windows 3.1, and it became the standard font format on both systems. Most fonts that come with Windows and macOS are TrueType or its successor, OpenType.

Today a .ttf file is, technically, an OpenType font with TrueType outlines. The OpenType specification, which Microsoft and Adobe built on top of TrueType from 1996 onwards, describes both .ttf and .otf files. The extension tells you which kind of outlines to expect, not which standard applies.

Anatomy

What's inside a TTF file

A TTF file is a short header, a directory of tables, and the tables themselves. Below is our sample-regular.ttf. Numbers are big-endian: 00 00 04 E4 is 0x4E4, which is 1,252.

sample-regular.ttf (hex)
offset  bytes                                            meaning
000000  00 01 00 00                                      version: TrueType outlines
000004  00 0A                                            10 tables
000006  00 80 00 03 00 20                                search helpers
        table directory, 16 bytes per table:
        tag         checksum    offset      length
00000C  4F 53 2F 32 5A 99 5C 1A 00 00 01 28 00 00 00 60  OS/2
00001C  63 6D 61 70 0F A9 0E 75 00 00 03 14 00 00 01 06  cmap
00002C  67 6C 79 66 49 2B 66 13 00 00 04 E4 00 00 1E E0  glyf
00003C  68 65 61 64 30 8D 4A AA 00 00 00 AC 00 00 00 36  head
00004C  68 68 65 61 …                                    hhea
00005C  68 6D 74 78 …                                    hmtx
00006C  6C 6F 63 61 …                                    loca
00007C  6D 61 78 70 …                                    maxp
00008C  6E 61 6D 65 …                                    name
00009C  70 6F 73 74 …                                    post
        the head table:
0000AC  00 01 00 00 00 01 00 00 4F 61 3F BC 5F 0F 3C F5  versions, checksum, magic
0000BC  00 03 03 E8 …                                    flags, 1,000 units per em
        the glyph "o", inside glyf:
0009AE  00 02 00 2D FF F6 02 24 01 FE                    2 contours, bounding box
0009B8  00 0F 00 1F 00 00 25 …                           contour ends, no hints, points
002D44                                                   end of file: 11,588 bytes
  1. 100 01 00 00

    The version

    Identifies a font with TrueType outlines. A font with CFF outlines starts with OTTO instead. This header layout is called sfnt, and it's shared by TTF, OTF and the font inside every WOFF file.

  2. 200 0A

    The table count

    Ten tables, the minimum set for a working TrueType font without hinting or advanced layout.

  3. 300 80 00 03 00 20

    Search helpers

    searchRange, entrySelector and rangeShift: values derived from the table count that once let software binary-search the directory. Many readers ignore them.

  4. 467 6C 79 66 49 2B 66 13 00 00 04 E4 00 00 1E E0

    A directory entry

    The table name glyf, a checksum of its contents, where it starts (0x4E4) and its length (7,904 bytes). Entries are sorted alphabetically by tag, with capitals first.

  5. 5OS/2, cmap, hhea, hmtx …

    The tables

    cmap maps characters to glyph numbers, hmtx gives each glyph's width, hhea and OS/2 the line spacing, weight and embedding permissions, name the family name and licence, post the glyph names, maxp the glyph count (99) and loca where each glyph starts inside glyf.

  6. 600 01 00 00 00 01 00 00 4F 61 3F BC 5F 0F 3C F5

    The head table

    Table version, font revision (1.0), a checksum adjustment that makes the whole file add up to a fixed value, and the magic number 5F 0F 3C F5, which every valid head table contains.

  7. 700 03 03 E8

    Units per em

    The design grid: 0x3E8 is 1,000 units per em. All coordinates in the font are in these units. TrueType fonts often use 2,048, a power of two.

  8. 800 02 00 2D FF F6 02 24 01 FE

    A glyph

    The letter o: 2 contours (outside and inside), and its bounding box from (45, -10) to (548, 510). FF F6 is -10: the o dips 10 units below the baseline so it looks as tall as flat letters.

  9. 900 0F 00 1F 00 00 25 …

    Contours and points

    The last point of each contour (15 and 31, so 32 points in all), the length of the hinting instructions (0: this font is unhinted), then a flag byte and coordinates for each point. The flag's lowest bit says whether a point is on the curve or a control point.

Under the hood

How a TrueType font works

A TTF file is a small database. The header lists tables, each identified by a four-letter tag, and each table does one job. A font needs these to work:

TableWhat it holds
cmapWhich glyph to use for each Unicode character
glyf and locaThe outlines, and where each glyph's outline starts
headGlobal settings: units per em, bounding box, version
hhea and hmtxLine spacing, and each glyph's advance width and left side bearing
maxpThe number of glyphs, and limits for the hinting engine
nameFamily and style names, copyright, licence, designer
OS/2Weight and width class, Windows line spacing, embedding permissions
postGlyph names and underline position
GSUB, GPOS, kernOptional: ligatures, alternates, kerning and other layout features
cvt , fpgm, prepOptional: data and programs for hinting

Outlines. TrueType glyphs are drawn with straight lines and quadratic Bézier curves: each curve segment has one control point, against two in the cubic curves of PostScript and CFF fonts. A point is either on the outline or an off-curve control point, and two control points in a row imply an on-curve point halfway between them. Quadratic curves need more points for the same shape but are fast to draw.

Hinting. At small sizes on a screen, a letter is only a few pixels tall, and an outline scaled down blindly turns into a blur. TrueType fonts can carry instructions, small programs in a bytecode language, that nudge points onto the pixel grid so stems stay sharp and even. Good hinting is skilled, slow work; many modern fonts are hinted automatically or not at all, because high-resolution screens and modern rendering need it less. Our samples are unhinted.

Why an o dips below the line

Round letters are drawn slightly taller and deeper than flat ones, here by 10 units in 1,000. Without this overshoot, an o next to an x looks too small. You can see it in the glyph's bounding box in the anatomy above.

Related formats

TTF vs OTF vs WOFF2 and other font formats

TTFOTF (CFF)WOFF / WOFF2
OutlinesQuadratic curves (glyf)Cubic curves (CFF or CFF2)Either: they wrap a TTF or OTF
First four bytes00 01 00 004F 54 54 4F (OTTO)wOFF / wOF2
HintingInstructions in the font, very preciseHints about stems and zones; the rasteriser does the restSame as the font inside
Install on a computerYesYesNo, convert first
Use on a websiteWorks, but uncompressedWorks, but uncompressedMade for it; WOFF2 is the smallest
Our regular sample11,588 bytes12,172 bytes6,092 / 4,428 bytes

For installing on a computer, TTF and OTF are equally good: both support the same layout features, scripts and variable axes. Pick whichever the font maker supplies. For a website, convert to WOFF2 rather than serving the TTF: it's the same font at a fraction of the size. Two older formats you may still meet: .ttc, a TrueType collection holding several fonts that share tables, and .dfont, a TrueType font in the old Mac data-fork format.

Variants

Variable TTF fonts

Since OpenType 1.8 in 2016, a single TTF can hold a continuous range of styles. A variable font stores one set of outlines plus tables describing how each point moves along design axes such as weight (wght), width (wdth) or slant (slnt). The main extra tables are fvar (the axes and named styles), gvar (how the outlines change) and STAT (how the styles are named).

Our sample-variable.ttf has one axis, weight, from 300 to 700, with five named styles: Light, Regular, Medium, SemiBold and Bold. Apps with variable-font support show a weight slider or the named styles; on the web, font-weight: 300 700 in @font-face unlocks every weight in between.

Variable fonts often contain overlapping contours, because each piece of a letter moves on its own. That's allowed, but some older software draws thin lines or gaps where contours overlap. Tools that create static fonts from a variable one usually merge the overlaps.

How to

How to install, open and convert a TTF file

  • Windows: double-click the file to preview it in Font Viewer, then click Install. Right-click offers Install for all users. Fonts live in C:\Windows\Fonts, or in your user folder if installed only for you.
  • macOS: double-click to open it in Font Book and click Install. Font Book also checks fonts for problems (File, Validate File).
  • Linux: copy it to ~/.local/share/fonts and refresh the font cache, as below.
  • On a website: convert it to WOFF2 and load it with @font-face. Browsers accept TTF directly too, but it's bigger.
  • Convert: fontTools (pyftsubset, ttx, or a few lines of Python) and FontForge convert between TTF, OTF, WOFF and WOFF2; Google's woff2_compress turns a TTF straight into WOFF2.
  • Phones: iOS and Android don't install loose font files by double-tapping. On iOS, fonts come through apps or configuration profiles; on Android, through the manufacturer's theme app where available, or within individual apps.
Terminal
# Linux: install a font for your user, then refresh the font cache
mkdir -p ~/.local/share/fonts
cp sample-regular.ttf ~/.local/share/fonts/
fc-cache -f
fc-list | grep "99helpers"

Troubleshooting

Why won't my TTF font install or show up?

  • It's installed but not in the font menu. Most apps read the font list when they start: close and reopen the app. On Linux, run fc-cache -f.
  • "Not a valid font". The file is damaged, incomplete (an interrupted download), or not really a TTF: a renamed WOFF or WOFF2 file, or an HTML error page saved as .ttf. Check the first four bytes; they should be 00 01 00 00.
  • Boxes instead of letters. The font doesn't contain those characters. Boxes, often called tofu, are the missing-glyph shape (glyph 0, .notdef). Our sample-digits-subset.ttf shows this for every letter.
  • Fuzzy at small sizes on Windows. An unhinted or lightly hinted font can look soft at body-text sizes on lower-resolution screens. Try a hinted version of the font, or a size where it renders well.
  • Two versions conflict. If an old and a new version of a font have the same name, apps may pick the wrong one. Remove the old version and restart the app.
  • Bold or italic looks wrong. If the family has no real bold file installed, apps fake it by thickening the letters. Install the bold font too.

Rights and risks

Font licences and safety

A font file is software, and comes with a licence. Fonts bundled with an operating system are licensed for use on that system, not for redistribution or for putting on a website. Open-source fonts, usually under the SIL Open Font License, can be used, embedded and shared freely. Commercial fonts often need separate licences for desktop, web, app and e-book use.

The font itself records some of this. The name table carries copyright and licence text, and the OS/2 table's fsType field states the embedding permission: installable, editable, preview and print, or restricted, plus flags forbidding subsetting or allowing bitmap-only embedding. Word processors and PDF tools read fsType when deciding whether to embed a font in a document.

Font files are parsed by complex code, often deep inside the operating system, and font bugs have been exploited. The Duqu malware, discovered in 2011, used a crafted TrueType font in a Word document to attack the Windows kernel. Install fonts from sources you trust, and keep your system updated.

Free downloads

Sample TTF files to download

Free sample TTF fonts for testing font installers, renderers, converters, upload filters 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.

sample-regular.ttf · 11.3 KBDownload

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.ttf

The regular weight, built with fontTools. The specimen above is drawn with this exact file.

  1. Ten tables

    OS/2, cmap, glyf, head, hhea, hmtx, loca, maxp, name and post: the minimum for a working font, without hinting or kerning.

  2. 99 glyphs

    A to Z, a to z, 0 to 9, space, .,:;!?&@#()-'"/, á à â ä é è ê ë í ï ó ô ö ú ü ñ É Ü Ñ, plus .notdef and a dotless i used for í and ï.

  3. Monoline outlines

    Every letter is built from strokes of the same width, drawn as quadratic curves, with overlaps merged so each glyph is a clean set of contours.

  4. Metrics

    1,000 units per em, x-height 500, cap height 700, ascender 920 and descender -250 for line spacing; the digits share one width so numbers line up in tables.

  5. Names and licence

    Family 99helpers Sample, style Regular, weight class 400, fsType 0 (installable), and the licence with a link back to this page in the name table.

All sample TTF files

  • Regular weight

    sample-regular.ttf · 11.3 KB (11,588 bytes)

    99helpers Sample Regular (weight 400): a static TrueType font with 99 glyphs, unhinted, installable.

    • Testing font installation and rendering
    • A source file for TTF to WOFF2 conversion
  • Bold weight

    sample-bold.ttf · 11.1 KB (11,368 bytes)

    The same family at weight 700, with the bold style bits set, so apps pair it with the regular file as one family.

    • Testing style linking (the B button in a word processor)
    • Comparing real and synthetic bold
  • Variable font, weight 300 to 700

    sample-variable.ttf · 23.4 KB (23,920 bytes)

    A variable TrueType font with one wght axis from 300 to 700 and five named styles, using fvar, gvar, HVAR and STAT tables.

    • Testing variable-font support in apps and browsers
    • Generating static instances with fontTools
  • Digits-only subset

    sample-digits-subset.ttf · 3.2 KB (3,268 bytes)

    The regular font subset to 17 glyphs: 0 to 9, space and .,:-/. Any letter typed in it falls back to another font or shows as a missing glyph.

    • Testing missing-glyph and fallback behaviour
    • A small valid TTF for parser and upload tests

Ways to test with them

  • Installers: install sample-regular.ttf and sample-bold.ttf together; your apps should list one family, 99helpers Sample, with two styles.
  • Converters: convert sample-regular.ttf to WOFF2 and back, then compare with ttx -l; the same ten tables should come back.
  • Variable fonts: open sample-variable.ttf in an app with variable-font support and move the weight slider from 300 to 700.
  • Missing glyphs: type a word in sample-digits-subset.ttf; letters should fall back to another font or show as boxes.
  • Upload filters: check that your filter accepts font/ttf and the 00 01 00 00 signature, and rejects files that only have a .ttf name.

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 a TTF file? Give it a link.

Drop a TTF 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

TTF files, frequently asked

What is a TTF file?

A TrueType font: a file with the outlines, spacing and names of a typeface, which computers use to draw text. Install it to use the font in your apps.

How do I install a TTF 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.

What's the difference between TTF and OTF?

Mainly the outlines: TTF uses TrueType quadratic curves, OTF usually uses CFF cubic curves. Both are OpenType fonts with the same features, and both install the same way.

Can I use a TTF font on my website?

Yes, browsers accept TTF in @font-face, but convert it to WOFF2 first: it's the same font, much smaller. Check that the font's licence allows web use.

Why doesn't my font show up after installing it?

Most apps load the font list when they start, so restart the app. If it still doesn't appear, the file may be damaged or not a real TTF.

Why do I see boxes instead of letters?

The font has no glyph for those characters, so the missing-glyph shape is drawn. Use a font that covers the language, or let the app fall back to one that does.

What is the MIME type of a TTF file?

font/ttf, registered in RFC 8081 in 2017. Older servers send application/x-font-ttf or application/octet-stream.

Are TTF files safe?

Fonts can't run like programs, but bugs in font handling have been exploited in the past. Install fonts from trusted sources and keep your system updated.

Related formats

Other file types explained

Keep going

Related

Sources

Last reviewed 27 October 2026.