Skip to content

Local Font Access support

Published Updated

The Local Font Access API’s window.queryLocalFonts() method returns a promise for an array of FontData objects describing the fonts installed on a user’s device, gated behind a local-fonts permission prompt.

  • Legend
  • Yes
  • Partial
  • Flag
  • No
  • Unknown
Browser / PlatformSupportVersionsConfidenceSourceNotes
Chrome (Desktop)Yes103highsource—
Chrome (Android)No—highsource1
Edge (Desktop)Yes103highsource2
Firefox (Desktop)No—highsource3
Firefox (Android)No—highsource45
Safari (macOS)No—highsource6
Safari (iOS)No—highsource78
Samsung InternetNo—highsource910
WebView (Android)No—highsource1112
  1. Implementation tracking: https://crbug.com/40840834.
  2. Derived by browser-compat-data mirroring from Chrome.
  3. No Firefox support is recorded in browser-compat-data.
  4. No Firefox for Android support is recorded in browser-compat-data.
  5. Derived by browser-compat-data mirroring from Firefox.
  6. No Safari support is recorded in browser-compat-data.
  7. No Safari on iOS support is recorded in browser-compat-data.
  8. Derived by browser-compat-data mirroring from Safari.
  9. Implementation tracking: https://crbug.com/40840834.
  10. Derived by browser-compat-data mirroring from Chrome Android.
  11. Implementation tracking: https://crbug.com/40840834.
  12. Derived by browser-compat-data mirroring from Chrome Android.

Source data: /compatibility/local-font-access.json · Global usage: 37 % (StatCounter 2026-05)

Source: spec · MDN · Last verified 2026-10-03 · Confidence: high (computed from sources)

queryLocalFonts() must be called from inside a user gesture handler (for example a button’s click listener) — calling it at the top level of a script throws a SecurityError. Paste this whole snippet into an HTML file and click the button to exercise the real gesture-gated path:

<button id="choose-local-fonts">Choose local fonts</button>
<script>
document.querySelector('#choose-local-fonts').addEventListener('click', async () => {
const availableFonts = await window.queryLocalFonts();
for (const fontData of availableFonts) {
console.log(fontData.postscriptName, fontData.fullName, fontData.family, fontData.style);
}
});
</script>

Feature-detect queryLocalFonts before calling it, and fall back to a fixed list of CSS generic font families when it is unavailable or the call fails:

// CSS generic families used when local font enumeration is unavailable.
const BUNDLED_FONTS = ['system-ui', 'sans-serif', 'serif', 'monospace'];
async function listLocalFonts() {
if (!('queryLocalFonts' in window)) {
// Unsupported browser (Firefox, Safari, or older Chromium): local font
// enumeration isn't available, so offer the generic-family fallback instead.
return BUNDLED_FONTS;
}
try {
const fonts = await window.queryLocalFonts();
return fonts.map((fontData) => fontData.fullName);
} catch (err) {
// Permission denied, or called without a user gesture: same fallback.
return BUNDLED_FONTS;
}
}
  • Firefox and Safari do not implement queryLocalFonts() — per the table above, support is limited to Chromium desktop browsers, so always keep the generic-family fallback.
  • queryLocalFonts() is only available in secure contexts and, per MDN, throws a SecurityError when called without prior user interaction or when a Permissions Policy blocks the feature; catch NotAllowedError separately for a user-denied prompt.
  • Per MDN, the returned list is not guaranteed to be exhaustive or ordered like the filesystem — do not assume it reports every installed font.

← Back to the Compatibility explorer.