The glyphnames.json file is the central glyph mapping database for Nerd Fonts, providing a machine-readable index of all 10,000+ glyphs available in patched fonts. It maps human-readable glyph names to their Unicode codepoints and characters, enabling programmatic access to glyph information for web applications, documentation generation, and the interactive cheat sheet at nerdfonts.com.
For information about using glyphs in CSS stylesheets, see CSS Classes and Usage. For details on the icon sets themselves, see Icon Sets.
Sources: glyphnames.json1 bin/scripts/lib/README.md31-51
glyphnames.json is located in the repository root. It is generated by the generate-css.sh build script and consumed by multiple systems in the Nerd Fonts ecosystem. The same script also produces css/nerd-fonts-generated.css.
Data flow: glyphnames.json generation and consumption
Sources: glyphnames.json1 css/nerd-fonts-generated.css1-6 bin/scripts/lib/README.md31-51
The file contains a single JSON object with two main components:
| Field | Type | Description |
|---|---|---|
METADATA | Object | Build metadata including version and generation date |
| Glyph entries | Objects | Individual glyph mappings (10,000+ entries) |
Top-level structure of glyphnames.json
Sources: glyphnames.json1
The metadata section appears as the first key in the root object. Its content as of v3.4.0 is shown at glyphnames.json1
| Field | Description |
|---|---|
website | Public-facing website URL |
development-website | GitHub repository URL |
version | Nerd Fonts semantic version number |
date | ISO 8601 timestamp of file generation |
Sources: glyphnames.json1
Each glyph entry uses the glyph name as the key and contains exactly two fields. An example entry from glyphnames.json1:
"cod-account": { "char": "...", "code": "eb99" }
| Field | Type | Format | Description |
|---|---|---|---|
| Key (name) | String | {set}-{icon_name} | Unique identifier for the glyph |
char | String | Unicode character | The actual rendered glyph character |
code | String | Hexadecimal | Unicode codepoint, no U+ or 0x prefix, lowercase |
Sources: glyphnames.json1
Glyph names follow a consistent {set}-{icon_name} pattern where the prefix identifies the icon set. The {set} portion corresponds directly to the prefix used in i_*.sh filenames in bin/scripts/lib/.
Glyph name prefix → icon set → source file mapping
| Prefix | Icon Set | Source file (i_*.sh) | Example key |
|---|---|---|---|
cod- | Codicons | i_cod.sh | cod-account |
dev- | Devicons | i_dev.sh | dev-aarch64 |
custom- | Custom (Nerd Fonts) | (no i*.sh)_ | custom-ada |
fa- | Font Awesome | i_fa.sh | fa-glass |
fae- | Font Awesome Extension | i_fae.sh | fae-500px |
md- | Material Design Icons | i_md.sh | md-ab-testing |
oct- | Octicons | i_oct.sh | oct-alert |
ple- | Powerline Extra | i_ple.sh | ple-left-half-circle-thick |
pom- | Pomicons | i_pom.sh | pom-pomodoro-done |
seti- | Seti UI | i_seti.sh | seti-folder |
weather- | Weather Icons | i_weather.sh | weather-day-sunny |
iec- | IEC Power Symbols | i_iec.sh | iec-power |
logos- | Font Logos | i_logos.sh | logos-archlinux |
extra- | Extra (Progress) | i_extra.sh | extra-progress_empty_left |
Sources: glyphnames.json1 bin/scripts/lib/README.md31-51 bin/scripts/lib/i_all.sh9
Different icon sets occupy distinct Unicode Private Use Area (PUA) ranges. The code field in each glyph entry will fall within the set's assigned range.
| Range | Set (prefix) | Example code value |
|---|---|---|
| E5F0–E6FF | Custom (custom-) | e5ff (custom-folder) |
| E700–E8FF | Devicons (dev-) | e700 (dev-aarch64) |
| EA60–EC1F | Codicons (cod-) | eb99 (cod-account) |
| EE00–EE0B | Extra/Progress (extra-) | ee00 (extra-progress_empty_left) |
| F000–FFFF | Font Awesome, Octicons, others | f026 (fa-volume-off) |
The extra-* codepoint range is declared in bin/scripts/lib/i_extra.sh2-4
Sources: glyphnames.json1 bin/scripts/lib/i_extra.sh2-4
glyphnames.json is the source for generating CSS class definitions in css/nerd-fonts-generated.css via generate-css.sh. The key-to-class mapping is straightforward: the JSON key {set}-{name} becomes the CSS class .nf-{set}-{name}, and the code field becomes the CSS content value.
Mapping from glyphnames.json entry to CSS rule
The corresponding rules in css/nerd-fonts-generated.css begin at css/nerd-fonts-generated.css29-31 The @font-face declaration and base .nf class at css/nerd-fonts-generated.css8-27 are also generated by the same script.
Sources: glyphnames.json1 css/nerd-fonts-generated.css8-31
The i_*.sh scripts in bin/scripts/lib/ define the same glyphs as shell variables (using bash variable assignment syntax) for use in the cheat sheet and documentation. i_all.sh sources all individual i_*.sh files in sequence. The shell variables and glyphnames.json are parallel representations of the same data with a predictable naming difference.
Parallel systems: i_*.sh shell variables vs. glyphnames.json
The naming conversion between shell variables and JSON keys:
i_{set}_{icon_name} (underscores, i_ prefix){set}-{icon_name} (hyphens, no prefix)For example, the entry in i_extra.sh at bin/scripts/lib/i_extra.sh7 — i_extra_progress_empty_left — corresponds to the JSON key extra-progress_empty_left in glyphnames.json1
Sources: bin/scripts/lib/i_extra.sh7-12 bin/scripts/lib/i_all.sh9-27 bin/scripts/lib/README.md31-51
Because glyphnames.json is standard JSON at the repository root, it can be consumed by any language. The structure to keep in mind:
METADATA key when iterating glyph entries.code field is a lowercase hexadecimal string with no prefix (e.g. eb99, not U+EB99 or 0xeb99).char field contains the literal Unicode character at that codepoint.| Use Case | Key fields used |
|---|---|
| Generate documentation | All keys (grouped by prefix), code |
| Build an icon picker UI | Key (for CSS class name), char, code |
| Validate font codepoint coverage | code (compare against font cmap) |
| Implement search | Key (name-based), code |
| Unicode reference / lookup | code (convert to decimal or U+ notation) |
Sources: glyphnames.json1
Each glyph entry must have:
{set}-{icon_name} formatchar field containing the literal Unicode charactercode field with lowercase hexadecimal (no 0x or U+ prefix)The METADATA object must include all four fields: website, development-website, version, and date.
The i_all.sh aggregator at bin/scripts/lib/i_all.sh17-22 performs a duplicate name check on each i_*.sh file before sourcing it. If any variable name appears more than once within a single file, the script prints the duplicates and exits with an error. This ensures that glyphnames.json will not contain duplicate keys within a set.
Sources: glyphnames.json1 bin/scripts/lib/i_all.sh17-22
glyphnames.json is committed to the repository as a build artifact and updated with each release. The generate-css.sh script regenerates both glyphnames.json and css/nerd-fonts-generated.css in a single pass.
The file is regenerated per release to ensure:
METADATA.version and METADATA.date are currenti_*.sh files are includedsrc/glyphs/Sources: glyphnames.json1 css/nerd-fonts-generated.css1-6 bin/scripts/lib/README.md31-51
| Aspect | glyphnames.json | i_*.sh Scripts |
|---|---|---|
| Format | JSON | Bash variable assignments |
| Primary usage | Web, CSS, APIs | Shell scripts, cheat sheet |
| Access method | Parse JSON | source the file |
| Key/name format | {set}-{icon_name} (hyphens) | i_{set}_{icon_name} (underscores, i_ prefix) |
| Consumers | generate-css.sh, website | Documentation scripts, shell tools |
| Location | Repository root | bin/scripts/lib/ |
bin/scripts/lib/i_all.sh defines the set list at bin/scripts/lib/i_all.sh9 and loops over it at bin/scripts/lib/i_all.sh16-26 sourcing each i_${set}.sh file. Optionally, passing include-old-material as an argument at bin/scripts/lib/i_all.sh12-14 adds the legacy material set. Once sourced, shell scripts can access any glyph directly via its bash variable (e.g. $i_cod_account).
Sources: bin/scripts/lib/i_all.sh5-27 bin/scripts/lib/README.md31-51
The version number in the METADATA object tracks with Nerd Fonts releases. Changes between versions may include:
Always check the version field to ensure compatibility with your tools and scripts.
Sources: glyphnames.json1
Refresh this wiki
This wiki was recently refreshed. Please wait 3 days to refresh again.