Skip to content
YAS.SH
Network & DNS🔒 Browser (client-side)API available📴 Works offlinebeginner

User-Agent Parser

Parses User-Agent HTTP header strings into browser name, version, rendering engine, operating system, and bot flags.

Data stays in your browser
Ready to runInstant execution
All tools →
Result

What does this tool do?

Parses User-Agent HTTP header strings into browser name, version, rendering engine, operating system, and bot flags.

Why would I use it?

  • You are debugging web compatibility issues across iOS, Android, macOS, and Windows.
  • You want to identify search engine crawlers and automated bots from access logs.
  • You are building responsive feature detection or server-side routing.

Real-life example

Input
Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1
Output
Browser: Mobile Safari 17.0 · OS: iOS 17.0 · Device: iPhone (Mobile) · Bot: false

Extracts granular hardware and software tokens.

Input → Process → Output → Next

Input
Paste a User-Agent string or inspect your current browser UA.
Process
Applies browser and OS token regular expression classification.
Output
Structured breakdown of browser, engine, OS, device, and bot classification.
Next action
Use the insights for conditional routing or telemetry.

Common mistakes

  • Relying solely on User-Agent for critical security authorization (User-Agents can be forged).
  • Not handling novel browser tokens or privacy-reduced client hints.
  • Over-optimizing for specific minor version numbers.

What the result means

A normalized description of client browser, operating system, and hardware.

Privacy & security

Your input is processed entirely in your browser and never sent to a YAS server.

API

Endpoint
POST https://yas.sh/api/v1/tools/user-agent-parser
Request Header
Content-Type: application/json
cURL
curl -X POST "https://yas.sh/api/v1/tools/user-agent-parser" \
  -H "Content-Type: application/json" \
  -d '{"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"}'
JavaScript
const res = await fetch("https://yas.sh/api/v1/tools/user-agent-parser", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"
}),
});
const data = await res.json();
Python
import requests

r = requests.post("https://yas.sh/api/v1/tools/user-agent-parser", json={"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"})
data = r.json()
FieldTypeRequiredDescription
userAgentstringYesUser-Agent string
Success response
{ "slug": "user-agent-parser", "browser": { "name": "Chrome" }, "os": { "name": "macOS" } }

Parse User-Agent string into browser, OS and device.

Error responses
  • 400 VALIDATION_ERROR — invalid input or unsupported option.
  • 413 PAYLOAD_TOO_LARGE — input exceeds the 64 KB limit.
  • 429 RATE_LIMIT_EXCEEDED — rate limit exceeded (60 req/min).
Limits
  • Maximum input: 64 KB per request.
  • Rate limit: 60 requests/min per IP address.
  • Authenticated accounts benefit from higher tier quotas.

User-Agent Parser: technical reference, use cases and FAQ

How User-Agent Parser works

A User-Agent string is parsed by matching it against an ordered set of patterns for browsers, rendering engines, operating systems and device families. Order matters enormously because the format is historically dishonest: Chrome's UA claims to be Mozilla, KHTML, Gecko and Safari all at once, a legacy of decades of servers gating features on substring checks. Edge must be matched before Chrome, and Chrome before Safari, or every result is wrong.

The platform is moving away from this string. Chrome has frozen and reduced UA detail, replacing it with User-Agent Client Hints — structured headers (Sec-CH-UA, Sec-CH-UA-Platform, Sec-CH-UA-Mobile) that a site must explicitly request. Parsing the legacy string still works for analytics and logs, but a modern Chrome UA deliberately reports a rounded version and a generic platform.

When to use it: real-world scenarios

Segmenting analytics or server logs

Aggregate browser and OS distribution from access logs to decide which platforms your support matrix actually needs to cover.

Reproducing a browser-specific bug report

The UA from an error report identifies the exact browser and OS version, which is usually the fastest route to reproducing it.

Identifying bots and crawlers in traffic

Distinguishing search-engine crawlers from scrapers and from real users before analysing behaviour prevents badly skewed metrics.

Understanding what a client is sending

When an API rejects requests from one client, comparing the parsed UA against a working one narrows the difference quickly.

Pro tips

  • Never gate features on the User-Agent. Use feature detection — the UA is self-reported, spoofable and increasingly reduced by design.
  • Chrome's frozen UA reports a minor version of 0.0.0 and a generic platform. Use Client Hints if you genuinely need precise version data.
  • Verify crawler claims with forward-confirmed reverse DNS rather than trusting the string; anyone can claim to be Googlebot.
  • Expect long-tail garbage in real logs: embedded webviews, security scanners and misconfigured clients produce strings no parser recognises.

Limitations and edge cases

What this tool deliberately does not do, and where it will disagree with other implementations.

  • The string is self-reported and trivially forged, so it is evidence, not proof.
  • Reduced UAs on modern Chrome and Safari deliberately withhold precise version and platform detail.
  • Device model detection is unreliable outside a few well-known mobile families.
  • Pattern sets age: a browser released after the patterns were written parses as something else or as unknown.

Frequently asked questions

Why does Chrome's User-Agent mention Mozilla and Safari?
Historical compatibility. Servers gated features on substring checks, so each browser added the tokens of its predecessors. The string is a compatibility artefact, not a description.
Can I trust the User-Agent?
No. It is client-controlled and can say anything. Use it for aggregate analytics, never for security decisions or feature gating.
What are User-Agent Client Hints?
Structured headers (Sec-CH-UA and friends) that replace the freeform string. The browser sends a minimal set by default and more only when the site explicitly requests it, which improves privacy and reliability.
Why does the browser version look wrong?
Chrome freezes the minor version at 0.0.0 in the reduced UA. Precise version data now requires the high-entropy Client Hints, which the browser grants only on request.
Ask YAS AI
🍪 Cookies & privacy. Essential cookies keep you signed in and remember language and theme. Google AdSense and reCAPTCHA are Google technologies: AdSense runs only after Accept All; reCAPTCHA loads on sign-in and contact forms. See how Google uses data: https://policies.google.com/technologies/partner-sites cookie policy · privacy policy.
Settings