loading

Extract structured properties

Extract

Parses a user-agent string into a UserAgentProperties object with the browser name and version, layout engine, manufacturer, product and operating system details. With no argument it parses the current browser's own string.

C#
UserAgentProperties props = await userAgent.Extract();

Console.WriteLine(props.Name);      // "Chrome"
Console.WriteLine(props.Version);   // "126.0.0.0"
Console.WriteLine(props.Layout);    // "Blink"
Console.WriteLine(props.OsName);    // "Windows"
Console.WriteLine(props.OsVersion); // "10" - Windows 11 still says NT 10.0

// or analyze any string, e.g. one captured from a server log:
var other = await userAgent.Extract("Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 ...)");
Live sample
Custom user-agent string (optional)
extract output
Results will appear here when you interact with the samples.

Client Hints support and basics

IsClientHintsSupported / GetPlatform / IsMobile

User-Agent Client Hints (navigator.userAgentData) are the privacy-friendly successor to UA-string sniffing. These low-entropy reads are available without any prompt on supporting browsers.

C#
bool supported = await userAgent.IsClientHintsSupported();

string platform = await userAgent.GetPlatform();  // "Windows", "" when unsupported
bool mobile = await userAgent.IsMobile();
Live sample
client hints basics output
Results will appear here when you interact with the samples.

Brands

GetBrands

The low-entropy brand list identifies the browser and its engine family without revealing precise versions. Browsers without Client Hints return an empty array.

C#
UserAgentBrand[] brands = await userAgent.GetBrands();

foreach (var brand in brands)
{
    Console.WriteLine($"{brand.Brand} {brand.Version}");
}
Live sample
brands output
Results will appear here when you interact with the samples.

High-entropy values

GetHighEntropyValues

Detailed facts such as CPU architecture, exact platform version and device model must be requested hint by hint; the browser may decline any of them, so every property of the result is nullable.

C#
HighEntropyUserAgent values = await userAgent.GetHighEntropyValues(
    "architecture", "bitness", "model", "platformVersion", "fullVersionList");

Console.WriteLine(values.Architecture);    // "x86"
Console.WriteLine(values.Bitness);         // "64"
Console.WriteLine(values.PlatformVersion); // "15.0.0"
Live sample
high-entropy values output
Results will appear here when you interact with the samples.
Note:
Client Hints are Chromium-firstnavigator.userAgentData currently ships in Chromium-based browsers only; Firefox and Safari report it as unsupported. Always check IsClientHintsSupported first and fall back to Extract, which works everywhere because it parses the classic user-agent string.
Warning:
Feature-detect, don't UA-sniff User-agent strings are frozen, spoofed and reduced by modern browsers. Use this data for analytics, diagnostics and coarse tailoring - for behavior switches, prefer feature detection.

API reference

Member
Signature
Description
Extract
ValueTask<UserAgentProperties> Extract(string? userAgentString = null)
Parses the given (or current) user-agent string into structured browser, engine and OS properties.
IsClientHintsSupported
ValueTask<bool> IsClientHintsSupported()
True when the runtime exposes navigator.userAgentData (UA Client Hints).
GetBrands
ValueTask<UserAgentBrand[]> GetBrands()
Low-entropy brand list; empty on browsers without UA-CH.
IsMobile
ValueTask<bool> IsMobile()
True when the user agent identifies itself as a mobile device.
GetPlatform
ValueTask<string> GetPlatform()
The OS family reported by the UA-CH layer; empty string when unsupported.
GetHighEntropyValues
ValueTask<HighEntropyUserAgent> GetHighEntropyValues(params string[] hints)
Requests high-entropy UA values; each hint must be named explicitly and any may come back null.
An unhandled error has occurred. Reload 🗙