Parse Browser User Agent Strings Instantly (OS, Device & Engine)
Parse user agent strings to extract browser, operating system, device, and engine information. Essential for web analytics, device detection, and browser compatibility testing.
How to Use User Agent Parser
Quick Start Guide
- Paste User Agent: Copy a user agent string into the input area
- Auto-Detect: Or check "Use Current Browser" to analyze your own browser
- View Results: See parsed browser, OS, device, and engine information
- Try Examples: Click example buttons to see different user agent types
- Copy Data: Copy the user agent string or parsed JSON data
What is a User Agent?
A user agent (UA) is a string that web browsers and other applications send to web servers to identify themselves. It contains information about the browser, operating system, device, and rendering engine.
Purpose: Device detection, analytics, browser compatibility Format: Text string with browser and system information Usage: Web analytics, responsive design, feature detection Location: HTTP request headers (User-Agent header)
Why Parse User Agents?
Analytics & Tracking:
- Track which browsers visit your site
- Monitor mobile vs desktop traffic
- Identify popular operating systems
- Detect bot and crawler traffic
- Analyze browser version distribution
Development & Testing:
- Debug browser-specific issues
- Test responsive designs
- Implement feature detection
- Serve different content per device
- Provide browser-specific fallbacks
Security & Monitoring:
- Detect suspicious bots
- Block malicious crawlers
- Monitor unusual traffic patterns
- Identify outdated browsers
- Track attack vectors
User Agent Structure
Typical format:
Mozilla/5.0 (Platform) AppleWebKit/Version (KHTML, like Gecko) Browser/Version
Example breakdown:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Components:
- Mozilla/5.0: Historic compatibility token
- Windows NT 10.0: Operating system (Windows 10)
- Win64; x64: CPU architecture (64-bit)
- AppleWebKit/537.36: Rendering engine
- Chrome/120.0.0.0: Browser name and version
- Safari/537.36: Compatibility token
Parsed Information
This parser extracts:
Browser:
- Name (Chrome, Firefox, Safari, Edge, Opera)
- Full version number (120.0.0.0)
- Major version (120)
Operating System:
- Name (Windows, macOS, iOS, Android, Linux)
- Version number (10, 17.1, etc.)
Device:
- Type (desktop, mobile, tablet)
- Vendor (Apple, Samsung, Google)
- Model (iPhone, Pixel 7, iPad)
Engine:
- Name (WebKit, Gecko, Blink, Trident)
- Version number
CPU:
- Architecture (amd64, arm64, ia32)
Bot Detection:
- Identifies search engine crawlers
- Detects social media bots
- Flags automated tools
Common Use Cases
1. Detecting Mobile Devices
Purpose: Identify mobile visitors for responsive design
Example UA (iPhone):
Mozilla/5.0 (iPhone; CPU iPhone OS 17_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Mobile/15E148 Safari/604.1
Parsed:
- Device Type: mobile
- Vendor: Apple
- Model: iPhone
- OS: iOS 17.1.1
- Browser: Safari 17.1
Use case: Serve mobile-optimized content, redirect to mobile site, adjust layout.
2. Browser Version Detection
Purpose: Check if browser supports modern features
Example UA (Chrome):
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Parsed:
- Browser: Chrome
- Version: 120.0.0.0
- Major: 120
Use case: Show upgrade notice for old browsers, enable modern features, provide fallbacks.
3. Operating System Analytics
Purpose: Track OS distribution of visitors
Example UA (macOS):
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Safari/605.1.15
Parsed:
- OS: macOS
- Version: 10.15.7
- Browser: Safari 17.1
Use case: Analytics dashboards, OS-specific instructions, compatibility testing.
4. Bot Detection
Purpose: Identify search engine crawlers and bots
Example UA (Googlebot):
Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
Parsed:
- Bot: Yes (detected)
- Browser: Unknown (bot)
- Purpose: Search engine crawler
Use case: Serve different content to bots, block malicious crawlers, analytics filtering.
5. Tablet Detection
Purpose: Differentiate tablets from phones and desktops
Example UA (iPad):
Mozilla/5.0 (iPad; CPU OS 17_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Mobile/15E148 Safari/604.1
Parsed:
- Device Type: tablet
- Vendor: Apple
- Model: iPad
- OS: iOS 17.1
Use case: Tablet-optimized layouts, app download prompts, touch-friendly interfaces.
6. Debugging Browser Issues
Purpose: Identify specific browser/OS combination causing bugs
Example: User reports issue, provides UA:
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0
Parsed:
- Browser: Firefox 121
- OS: Windows 7
- Architecture: 64-bit
Use case: Reproduce bugs, test in specific environments, provide targeted fixes.
Features
Core Functionality
- Browser Detection: Chrome, Firefox, Safari, Edge, Opera
- OS Detection: Windows, macOS, iOS, Android, Linux
- Device Type: Desktop, mobile, tablet
- Engine Parsing: WebKit, Gecko, Blink, Trident
- Bot Detection: Search engines, social media bots
- Version Extraction: Full and major version numbers
Supported Browsers
- Google Chrome / Chromium
- Mozilla Firefox
- Apple Safari
- Microsoft Edge
- Opera / Opera Mini
- Internet Explorer (legacy)
- Mobile browsers (Chrome Mobile, Safari Mobile)
Supported Operating Systems
- Windows (7, 8, 8.1, 10, 11)
- macOS (10.x, 11.x, 12.x, 13.x, 14.x)
- iOS / iPadOS
- Android
- Linux distributions
- Chrome OS
Device Detection
- Smartphones (iPhone, Android phones)
- Tablets (iPad, Android tablets)
- Desktop computers
- Vendor identification (Apple, Samsung, Google, etc.)
- Model extraction where available
Bot Detection
Identifies:
- Search engine crawlers (Googlebot, Bingbot, etc.)
- Social media bots (Facebook, Twitter, LinkedIn)
- Monitoring services
- Automated tools
- Web scrapers
Best Practices
1. Use Feature Detection Over UA Sniffing
Prefer:
if ('geolocation' in navigator) {
// Use geolocation
}
Avoid:
if (userAgent.includes('Chrome')) {
// Assume Chrome has geolocation
}
Why: Feature detection is more reliable. User agents can be spoofed or outdated.
2. Combine with Analytics
Use UA parsing for:
- Traffic analysis
- Browser statistics
- Device breakdown
- Bot filtering
Don't rely solely on UA for:
- Security decisions
- Feature availability
- Critical functionality
3. Cache Parsed Results
Good:
const parsedUA = parseUserAgent(navigator.userAgent);
// Store in variable, use multiple times
Inefficient:
// Parsing repeatedly
parseUserAgent(navigator.userAgent).browser.name
parseUserAgent(navigator.userAgent).os.name
4. Handle Unknown Values
Always check:
const browser = parsed.browser.name || 'Unknown';
const version = parsed.browser.version || 'N/A';
Reason: Not all user agents contain complete information.
5. Update Parsing Logic Regularly
User agents change:
- New browser versions
- New devices
- Updated OS versions
- New UA formats
Solution: Use maintained libraries in production, update parsing patterns regularly.
Technical Details
How User Agent Parsing Works
1. Receive UA string from HTTP header or navigator.userAgent
2. Apply regex patterns to identify browser
3. Extract version numbers using pattern matching
4. Detect operating system from platform indicators
5. Identify device type from mobile/tablet keywords
6. Extract rendering engine information
7. Determine CPU architecture from system info
8. Check against bot patterns for crawler detection
9. Return structured data object
Parsing Patterns
Browser detection:
- Chrome: /Chrome\/([\d.]+)/
- Firefox: /Firefox\/([\d.]+)/
- Safari: /Version\/([\d.]+)/
- Edge: /Edg\/([\d.]+)/
OS detection:
- Windows: /Windows NT ([\d.]+)/
- macOS: /Mac OS X ([\d_]+)/
- iOS: /OS ([\d_]+)/
- Android: /Android ([\d.]+)/
Device detection:
- Mobile: /Mobile|iPhone/
- Tablet: /iPad|Tablet/
- Desktop: everything else
Limitations
This is a basic parser:
- Regex-based pattern matching
- Limited to common browsers/OS
- May not detect all devices
- Simplified bot detection
- No user agent validation
For production analytics:
- ua-parser-js: Comprehensive UA library
- bowser: Lightweight browser detection
- platform.js: Detailed platform info
- Google Analytics: Built-in UA parsing
User agents can be:
- Spoofed or faked
- Incomplete or malformed
- Custom from apps/tools
- Modified by proxies
Browser Compatibility
Works in all browsers that support JavaScript ES6+:
- ✅ Chrome 90+
- ✅ Firefox 88+
- ✅ Safari 14+
- ✅ Edge 90+
- ✅ Opera 76+
Auto-detection requires:
- Browser environment (not Node.js)
- Access to navigator.userAgent
Privacy & Security
Client-Side Processing
- 100% Local: All parsing in your browser
- No Uploads: UA strings never sent to server
- No Storage: Nothing saved or cached
- No Tracking: No analytics on your UA
- No Accounts: No login required
Privacy Notes
User agents reveal:
- Browser and version
- Operating system
- Device type
- General location indicators (language)
User agents do NOT reveal:
- Personal information
- Exact location
- Browsing history
- Installed extensions
- Specific user identity
For privacy:
- Some browsers send simplified UAs
- Brave/Firefox offer UA protection
- VPNs may modify UAs
- Privacy extensions can spoof UAs
Common Patterns
Web Analytics
const ua = navigator.userAgent;
const parsed = parseUserAgent(ua);
trackAnalytics({
browser: parsed.browser.name,
browserVersion: parsed.browser.major,
os: parsed.os.name,
deviceType: parsed.device.type,
isBot: parsed.isBot
});
Responsive Design
const parsed = parseUserAgent(navigator.userAgent);
if (parsed.device.type === 'mobile') {
// Load mobile stylesheet
loadMobileCSS();
} else if (parsed.device.type === 'tablet') {
// Load tablet layout
loadTabletLayout();
}
Browser Compatibility
const parsed = parseUserAgent(navigator.userAgent);
if (parsed.browser.name === 'Chrome' && parseInt(parsed.browser.major) < 90) {
showUpgradeBanner();
}
Bot Filtering
const parsed = parseUserAgent(req.headers['user-agent']);
if (parsed.isBot) {
// Serve static HTML for bots
return renderStaticPage();
}
Integration Tips
Server-Side (Node.js)
// Express.js example
app.get('/', (req, res) => {
const ua = req.headers['user-agent'];
const parsed = parseUserAgent(ua);
if (parsed.device.type === 'mobile') {
res.redirect('/mobile');
} else {
res.render('desktop');
}
});
Analytics Tracking
// Track device types
const parsed = parseUserAgent(navigator.userAgent);
gtag('event', 'page_view', {
device_type: parsed.device.type,
browser: parsed.browser.name,
os: parsed.os.name
});
A/B Testing
// Serve different variants by browser
const parsed = parseUserAgent(navigator.userAgent);
if (parsed.browser.name === 'Safari') {
showVariantA();
} else {
showVariantB();
}
Note: For production use with comprehensive UA parsing, consider using established libraries like ua-parser-js or bowser. This tool is perfect for quick analysis, debugging, learning about user agents, and privacy-focused parsing.
Frequently Asked Questions
Most Viewed Tools
TOTP Code Generator
Generate time-based one-time passwords from a TOTP secret key. Enter your base32 secret, choose a period and digit length, and get the current and next codes with a live countdown timer. Useful for testing and debugging 2FA integrations.
Use Tool →JSON to Zod Schema Generator
Generate Zod validation schema code from a JSON sample object. Infers z.string(), z.number(), z.boolean(), z.array(), z.object(), and z.null() types automatically. Handles nested objects, arrays of objects with optional field detection, and outputs copy-ready TypeScript with import and z.infer type alias.
Use Tool →JSONL / NDJSON Formatter
Format, validate, and inspect JSON Lines (JSONL) and NDJSON files. Validates each line individually, reports parse errors by line number, outputs compact JSONL or a pretty-print preview, and lets you download the cleaned file.
Use Tool →Secret and Credential Scanner
Scan pasted text, code, or config files for accidentally exposed API keys, tokens, passwords, and private keys. Detects 50+ secret types across AWS, GitHub, Stripe, OpenAI, and more — all client-side, nothing leaves your browser.
Use Tool →TLS Cipher Suite Checker
Check TLS protocol version compatibility and cipher suite strength ratings against current best practices. Supports IANA and OpenSSL cipher names — rates each suite as Strong, Weak, or Deprecated and explains why.
Use Tool →Password Entropy Calculator
Calculate the information-theoretic bit entropy of any password or API key. Detects character set pools automatically, shows the total number of possible combinations, and estimates crack time across five attack scenarios from rate-limited web logins to GPU cracking clusters.
Use Tool →TOML Config Validator
Validate TOML configuration file syntax and report errors with line numbers. Paste any TOML content — Cargo.toml, pyproject.toml, config.toml — and instantly see a green checkmark with key counts and structure stats, or a precise error message pointing to the exact line. Includes a collapsible JSON structure preview to confirm what was parsed.
Use Tool →Content Security Policy Generator
Build Content Security Policy headers interactively. Toggle directives like script-src, style-src, and img-src, select allowed source tokens, and add custom origins. Instantly outputs your CSP as an HTTP header, meta tag, Nginx directive, or Apache header.
Use Tool →Related DevOps & Infrastructure Tools
Query String Parser
Parse URL query strings into readable key-value pairs. Decode parameters and inspect URL search queries with ease.
Use Tool →API Response Formatter
Format and beautify API responses for better readability. JSON formatter with minify and prettify options.
Use Tool →SSL Certificate Validator
Paste a PEM certificate to instantly validate expiry, signature algorithm, key strength, SAN presence, and trust chain. Get a clear pass/warn/fail report for each check.
Use Tool →Cookie Parser
Parse HTTP cookie strings into readable key-value pairs. Decode URL-encoded values and inspect cookies from browser requests.
Use Tool →Cron Expression Validator
Validate cron expressions, get a plain-English explanation of what they mean, and see the next scheduled run times — all in your browser.
Use Tool →robots.txt Validator
Validate your robots.txt file against the Robots Exclusion Protocol. Checks directive syntax, path formats, Crawl-delay values, and Sitemap URLs. Previews crawl rules per user-agent group. Free and runs entirely in your browser.
Use Tool →Sitemap Validator
Validate XML sitemaps against the sitemap protocol specification. Checks structure, required fields, URL count, changefreq values, and priority ranges. Supports both URL sitemaps and sitemap index files. Free and runs entirely in your browser.
Use Tool →HTTP Header Analyzer
Parse and analyze HTTP request or response headers. Identifies categories, explains each header, flags missing security headers, and detects duplicates or suspicious values — entirely in your browser.
Use Tool →Share Your Feedback
Help us improve this tool by sharing your experience