ua-parser-js is a free, open source marketing & customer engagement project written in JavaScript and released under AGPL-3.0. It has 10,189 GitHub stars, 1,217 forks and 14 open issues, and was last pushed 16 days ago. On this registry it ranks #15 of 50 tracked projects in Marketing & Customer Engagement, with 5 head-to-head comparisons available.

What is ua-parser-js?

UAParser.js is a dependency-free JavaScript library for user-agent detection that identifies browsers, operating systems, devices, bots, apps, and AI crawlers, running both in the browser (client-side) and in Node.js (server-side), and it is aimed at web developers, analytics teams, and product engineers who need to classify the traffic reaching their applications.

What it is

UAParser.js is a compact, ES5-friendly, dependency-free JavaScript library published in the JavaScript and npm ecosystem. Its detection logic is backed by an actively maintained, extensive detection database, and it runs seamlessly in browsers, Node.js, and modern JavaScript runtimes. The project is documented across two lines: version 1.x at docs.uaparser.dev/v1 and version 2.x at docs.uaparser.dev, with a live demo at uaparser.dev.

The concrete problem it solves is the parsing of user-agent strings, which is otherwise hand-rolled regex work that drifts out of date as new browsers, operating systems, devices, bots, and crawlers appear. Instead of maintaining that parsing logic in-house, a developer calls one library and receives structured browser, OS, device, rendering engine, and CPU information. The same code path serves both client-side and server-side use, so an analytics pipeline and an in-page script can classify a visitor consistently. Teams upgrading from v0.7 or v1.0 are directed to CHANGELOG.md for what is new and breaking.

Key capabilities

  • Browser detection across the browser, Node.js, and modern JavaScript runtime targets, using the same library in each environment.
  • Detection of operating systems, devices, and mobile devices, plus CPU detection and rendering engine detection.
  • Bot detection and AI crawler detection, alongside extra detections for apps, libraries, emails, media players, and crawlers, all restricted to the commercial editions in the README feature matrix.
  • Client Hints support and ESM support, both listed as PRO-only, while CommonJS support and TypeScript definitions are available across editions.
  • A managed REST API at uaparser.dev/#rest-api that works with JavaScript, Python, PHP, Java, or any HTTP client, powered by UAParser.js and described as zero maintenance.
  • Distribution as an npm module as well as direct downloads, with open-source editions under MIT (v1.x) and AGPL-3.0 (v2.x).

Who uses it and how

  • Analytics practitioners, reflected in the analytics, mobile-detection, and device-detection topics, who segment traffic by browser, OS, and device type.
  • Security and anti-abuse teams using the bot-detection capability to separate automated traffic from human visitors before it reaches application logic.
  • Server-side Node.js services that classify requests centrally rather than trusting client-reported values.
  • Client-side browser scripts that need detection without pulling in dependencies, which the README supports by describing the library as dependency-free and ES5-friendly.
  • Large-scale deployments, since the README describes the library as battle-tested at scale and trusted by leading tech companies.

Getting started

Install from the npm module listed among the package options, or download the package directly, and follow the version-specific documentation at docs.uaparser.dev/v1 for version 1.x or docs.uaparser.dev for version 2.x. Teams that prefer not to install anything can use the managed REST API at uaparser.dev/#rest-api from any HTTP client.

How it compares

This registry names no directly comparable user-agent parsing tool, so UAParser.js stands alone here. The only contrast the facts support is internal: the open-source editions under MIT (v1.x) and AGPL-3.0 (v2.x) sit beside the PRO Personal, PRO Business, and PRO Enterprise commercial licences, priced at $14, $29, and $599 respectively, which add bot detection, AI detection, Client Hints support, ESM support, and enhanced accuracy. Choosing between them is therefore a question of whether the open-source licence terms and feature set are sufficient, rather than of switching vendors.

When to use it — and when not

Use it when the requirement is user-agent classification in JavaScript on either the client or the server, and the open-source detection scope is enough. Do not choose the AGPL-3.0 v2.x edition if copyleft obligations are unacceptable and the MIT v1.x line is unsuitable, and do not expect bot detection, AI detection, Client Hints support, ESM support, or enhanced accuracy without a commercial licence, since the README feature matrix marks each of those as unavailable in the open-source editions. The README does not describe any database, storage, or mail server that a self-hoster must operate, so the operational burden is limited to running the library or the managed API.

project readme (upstream, from github) — read inline

UAParser.js

UAParser.js UAParser.js UAParser.js

UAParser.js

Powerful User-Agent detection in a compact, ES5-friendly, dependency-free JavaScript library.

  • Comprehensive detection: Identify various kind of browsers, OS, devices, bots, apps, AI crawlers, and more
  • Battle-tested at scale: Backed by an actively maintained, extensive detection database, trusted by leading tech companies
  • Runs everywhere: Use seamlessly in browsers, Node.js, and modern JavaScript runtimes

Demo

Documentation

Before upgrading from v0.7 / v1.0, please read CHANGELOG to see what's new & breaking.

Package Options

Open-Source Editions PRO / Commercial Editions
License options MIT (v1.x) AGPL (v2.x) PRO Personal PRO Business PRO Enterprise
Browser Detection ⚠️
CPU Detection ⚠️
Device Detection ⚠️
Rendering Engine Detection ⚠️
OS detection ⚠️
Enhanced+ Accuracy
Bot Detection
AI Detection
Extra Detections (Apps, Libs, Emails, Media Players, Crawlers, and more)
Client Hints Support
CommonJS Support
ESM Support
TypeScript Definitions
npm Module Available
Direct Downloads Available
Commercial Use Allowed
Permissive (non-Copyleft) License
No Open-Source Obligations
Unlimited End-Products
Unlimited Deployments
1-year Product Support
Lifetime Updates
Price FREE* (License) FREE* (License) $14 (License) $29 (License) $599 (License)

GET THE PRO PACKAGES 📥

NEW: Managed REST API

Skip the installation, use the User-Agent API in any application:

  • Works everywhere: Integrate with JavaScript, Python, PHP, Java, or any HTTP client
  • Production-ready: Powered by UAParser.js and continuously updated
  • Zero maintenance: We manage the packages, parser updates, device data, and infrastructure for you

Learn more and start building at uaparser.dev/#rest-api

Development

Contributors

This project wouldn't be possible without all the amazing people in the open-source community. Thanks to everyone who contributed, reported issues, and shared feedback.

Made with contributors-img.

Contributions are welcome! Please read the CONTRIBUTING GUIDE first for detailed contribution instructions.

Backers & Sponsors

<a href="https://op

readme truncated — read the full docs on github

Frequently asked questions

Is ua-parser-js free to use?

ua-parser-js is open source under the AGPL-3.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does ua-parser-js do?

UAParser.js - The Essential Web Development Tool for User-Agent Detection. Detect Browsers, OS, Devices, Bots, Apps, AI Crawlers, and more. Run in Browser (clie

What is ua-parser-js written in?

ua-parser-js is primarily written in JavaScript. Its source is publicly available at https://github.com/faisalman/ua-parser-js, and it has 10,189 GitHub stars.