JavaScript Navigator userAgentData Property

Beginner
⏱️ 10 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Experimental

What You’ll Learn

navigator.userAgentData is the experimental entry point to User-Agent Client Hints. Learn NavigatorUAData low-entropy fields (brands, mobile, platform), how getHighEntropyValues() works, secure-context rules, five examples, and try-it labs.

01

Kind

Read-only property

02

Returns

NavigatorUAData

03

Status

Experimental

04

Context

Secure (HTTPS)

05

Low entropy

brands / mobile / platform

06

High entropy

getHighEntropyValues()

Introduction

The classic navigator.userAgent string is one long, hard-to-parse label. User-Agent Client Hints offer a cleaner API: structured fields for brand, mobile, and platform — with more detailed data only when you ask for it.

navigator.userAgentData returns a NavigatorUAData object. Beginners usually start with three low-entropy properties:

  • brands — array of { brand, version } objects
  • mobiletrue if the UA looks mobile
  • platform — platform brand string (for example "Windows")
💡
Low vs high entropy

MDN: low-entropy values reveal less about the user. High-entropy values (architecture, model, full version list, …) can be more identifying, so they are requested asynchronously with getHighEntropyValues().

Understanding the userAgentData Property

Think of userAgentData as a modern client-hints door on navigator — not a replacement for feature detection when you need an API.

  • NavigatorUAData — object returned by the property.
  • Low entropybrands, mobile, platform (sync reads).
  • High entropy — request via Promise with getHighEntropyValues().
  • Secure context — HTTPS / localhost in supporting browsers.
  • Workers — MDN notes NavigatorUAData is also available via WorkerNavigator.userAgentData.
  • Limited support — commonly Chromium-based; missing in some major browsers.

📝 Syntax

General form of the property:

JavaScript
navigator.userAgentData

Value

  • A NavigatorUAData object (when supported).

Common patterns

JavaScript
// Always feature-detect first
if ("userAgentData" in navigator) {
  console.log(navigator.userAgentData.brands); // MDN example
  console.log(navigator.userAgentData.mobile);
  console.log(navigator.userAgentData.platform);
} else {
  console.log("userAgentData not available — fall back or skip.");
}

// High-entropy hints (async)
if (navigator.userAgentData?.getHighEntropyValues) {
  navigator.userAgentData
    .getHighEntropyValues(["architecture", "platform", "platformVersion"])
    .then((ua) => console.log(ua));
}

⚡ Quick Reference

GoalCode
Get NavigatorUADatanavigator.userAgentData
Feature detect"userAgentData" in navigator
Brands listnavigator.userAgentData.brands
Mobile?navigator.userAgentData.mobile
Platformnavigator.userAgentData.platform
High-entropy hintsgetHighEntropyValues([…])
Secure context?window.isSecureContext

🔍 At a Glance

Four facts to remember about navigator.userAgentData.

Returns
NavigatorUAData

Client Hints

Status
Experimental

Not Baseline

Context
HTTPS

Secure required

Ask more
getHigh…

Async Promise

📋 userAgent String vs userAgentData

navigator.userAgentnavigator.userAgentData
ShapeOne long stringStructured object + methods
Baseline?Yes (widely available)No — Limited / Experimental
Privacy modelOften reduced / frozenLow entropy first; high entropy on request
Best forLogs / legacyStructured Client Hints when supported
Feature gates?Do not sniff brandsStill prefer API feature detection

Examples Gallery

Examples follow MDN navigator.userAgentData patterns. Prefer Try It Yourself in Chrome / Edge on HTTPS — Firefox and Safari may report the API missing.

📚 Getting Started

Detect the API and read the MDN brands example.

Example 1 — Feature Detection

Check support and secure context before reading hints.

JavaScript
const lines = [
  "userAgentData: " + ("userAgentData" in navigator ? "available" : "missing"),
  "isSecureContext: " + window.isSecureContext
];
console.log(lines.join("\n"));
Try It Yourself

How It Works

Experimental APIs must be detected. A missing property is normal — not an error.

Example 2 — Read brands

MDN’s basic example: print brand / version pairs.

JavaScript
if (!("userAgentData" in navigator)) {
  console.log("userAgentData not supported");
} else {
  console.log(navigator.userAgentData.brands);
  // Often looks like:
  // [{ brand: "Chromium", version: "143" }, { brand: "Google Chrome", version: "143" }, ...]
}
Try It Yourself

How It Works

Brands are structured Client Hints — easier than scraping substrings from userAgent.

📈 Practical Patterns

Low-entropy fields, compare with the classic UA string, and request high-entropy hints.

Example 3 — Low-Entropy Fields

Read mobile and platform together with brands.

JavaScript
if (!("userAgentData" in navigator)) {
  console.log("userAgentData not supported");
} else {
  const ua = navigator.userAgentData;
  const brandNames = ua.brands.map((b) => b.brand).join(", ");
  console.log("brands: " + brandNames);
  console.log("mobile: " + ua.mobile);
  console.log("platform: " + ua.platform);
}
Try It Yourself

How It Works

These sync properties are the low-entropy surface — usually enough for coarse UI hints.

Example 4 — Compare with userAgent

Show structured hints beside the classic string (for learning, not sniffing).

JavaScript
const lines = [];
lines.push("classic userAgent length: " + navigator.userAgent.length);

if ("userAgentData" in navigator) {
  lines.push("clientHints platform: " + navigator.userAgentData.platform);
  lines.push("clientHints mobile: " + navigator.userAgentData.mobile);
} else {
  lines.push("clientHints: not supported — keep a fallback");
}

console.log(lines.join("\n"));
Try It Yourself

How It Works

userAgent is Baseline everywhere; userAgentData is structured but not universal yet.

Example 5 — getHighEntropyValues()

MDN-style async request for higher-entropy hints.

JavaScript
async function readHighEntropy() {
  if (!navigator.userAgentData?.getHighEntropyValues) {
    return "getHighEntropyValues not available";
  }
  const ua = await navigator.userAgentData.getHighEntropyValues([
    "architecture",
    "model",
    "platform",
    "platformVersion",
    "fullVersionList"
  ]);
  return JSON.stringify(ua, null, 2);
}

readHighEntropy().then((text) => console.log(text));
Try It Yourself

How It Works

High-entropy values return via a Promise so the browser can apply privacy checks before revealing more detail.

🚀 Common Use Cases

  • Structured brand lists — read brands instead of parsing UA substrings.
  • Coarse device class — use mobile as a hint (not as the only responsive strategy).
  • Platform label — display or log platform when Client Hints exist.
  • Optional high-detail telemetry — request architecture / platformVersion only when needed.
  • Progressive enhancement — fall back to userAgent logs when the API is missing.

🧠 How navigator.userAgentData Works

1

Secure page loads

HTTPS / localhost in a supporting browser.

HTTPS
2

Read low-entropy hints

brands, mobile, and platform are available sync.

Low
3

Optionally ask for more

getHighEntropyValues() returns a Promise with richer data.

High
4

Keep a fallback

If missing, use logs / feature detection — never require Client Hints for core UX.

📝 Notes

  • Experimental & Limited availability — not Baseline; feature-detect always.
  • Not Deprecated or Non-standard — Experimental banner only.
  • Secure context required (HTTPS / localhost).
  • Returns NavigatorUAData; main sync fields are brands, mobile, platform.
  • Related: vendor, userAgent, platform, product.

Limited / Experimental Support

navigator.userAgentData belongs to the experimental User-Agent Client Hints API and is not Baseline. Support is limited (commonly Chromium-based). Always feature-detect, use HTTPS, and keep a fallback.

Experimental · Not Baseline

Navigator.userAgentData

NavigatorUAData entry point for Client Hints — brands, mobile, platform, and optional high-entropy values.

Limited Experimental
Google Chrome Client Hints UA Data / Chromium path
Limited
Microsoft Edge Follow Chromium Client Hints support
Limited
Opera Follow Chromium Client Hints support
Limited
Mozilla Firefox Typically unavailable — feature-detect
Unavailable
Apple Safari Typically unavailable — feature-detect
Unavailable
Internet Explorer No userAgentData support
Unavailable
userAgentData Limited

Bottom line: Detect navigator.userAgentData, read low-entropy fields first, request high-entropy values only when needed, and never require the API for core features.

Conclusion

navigator.userAgentData is the experimental Client Hints entry point on Navigator. Use it for structured low-entropy hints when available, request high-entropy values carefully, and keep feature detection as your source of truth for capabilities.

Continue with vendor, userAgent, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Feature-detect "userAgentData" in navigator
  • Use HTTPS / localhost
  • Start with low-entropy fields
  • Request high-entropy hints only when needed
  • Keep a fallback when the API is missing

❌ Don’t

  • Assume Baseline support in every browser
  • Gate critical features on brand strings alone
  • Ignore secure-context requirements
  • Treat high-entropy data as free / private-safe forever
  • Assign to navigator.userAgentData

Key Takeaways

Knowledge Unlocked

Five things to remember about userAgentData

Experimental Client Hints — structured brands, low then high entropy, HTTPS.

5
Core concepts
02

Status

Experimental

Limited
🔒 03

Context

secure HTTPS

Required
📊 04

Low

brands / mobile

Sync
🎯 05

High

getHighEntropyValues

Async

❓ Frequently Asked Questions

A NavigatorUAData object from the User-Agent Client Hints API. It exposes low-entropy brand, mobile, and platform hints, plus getHighEntropyValues() for more detailed (higher-entropy) data.
MDN marks it Experimental and Limited availability (not Baseline). It is not Deprecated or Non-standard. Always feature-detect and keep a fallback.
Yes. MDN lists it as a secure-context feature (HTTPS or localhost) in supporting browsers.
Low-entropy NavigatorUAData properties: brands is an array of {brand, version} objects, mobile is a boolean, and platform is a platform brand string.
An async method that requests higher-entropy hints (for example architecture, model, platformVersion, fullVersionList). It returns a Promise so the browser can run checks before revealing more identifying data.
Client Hints are designed to be a better-structured alternative to scraping the UA string — but support is still limited. Prefer feature detection for capabilities, and feature-detect userAgentData before relying on it.
Did you know?

Chromium often includes a greasy brand like "Not A;Brand" in brands on purpose. That anti-fingerprinting trick makes naive brand sniffing less reliable — another reason to prefer feature detection for real capabilities.

Learn vendor Next

Baseline vendor string with only three MDN-documented values.

vendor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful