Structured when possible
Client Hints take priority when available, with User-Agent fallback everywhere else.
Client Hints →v0.2.0 · zero runtime dependencies
A tiny, type-safe classifier for User-Agent strings, Client Hints, and HTTP headers. Get browser, OS, device, engine, and bot signals—with confidence built in.
$ npm install client-parserMozilla/5.0 (iPhone; CPU iPhone OS 17_5…
Interactive playground
Paste a User-Agent or use your browser’s available evidence. The result comes directly from client-parser 0.2.0, including source and confidence.
{
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
"device": {
"type": "desktop",
"name": "Desktop"
},
"browser": {
"name": "Chrome",
"version": "126.0.0.0",
"major": "126"
},
"os": {
"name": "Windows",
"version": "10.0"
},
"engine": {
"name": "Blink"
},
"bot": {
"isBot": false
},
"isMobile": false,
"isTablet": false,
"source": [
"user-agent"
],
"confidence": "medium"
}Designed for honest answers
Client Hints take priority when available, with User-Agent fallback everywhere else.
Client Hints →A stable result shape covers device, browser, OS, engine, bots, evidence, and confidence.
Result shape →No runtime dependencies, no network requests, no stored data, and an 8 KiB input cap.
Privacy notes →One function to begin
Use a direct User-Agent string in any runtime, or pass headers and Client Hints when your platform exposes them.
See every input form →import { parseClient } from 'client-parser'
const client = parseClient(
request.headers.get('user-agent'),
)
client.device.type // "mobile"
client.browser.name // "Chrome"
client.confidence // "high"Small package. Clear answers.