# hgoebl/mobile-detect.js

Device detection (phone, tablet, desktop, mobile grade, os, versions)

Repository: https://github.com/hgoebl/mobile-detect.js
Canonical: https://ross.abutalabs.com/products/mobile-detectjs
Homepage: http://hgoebl.github.io/mobile-detect.js/
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2021-03-13T09:22:29+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4739, "days_push": 1999, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4138, forks 865 (observed 2026-08-28T04:08:36.230804+00:00)

## What it is
mobile-detect.js is a JavaScript library that detects device type (phone, tablet, desktop), operating system, and versions by matching regular expressions against a User-Agent string. It is a loose port of the PHP Mobile-Detect library and works in both the browser and Node.js.

## Use cases
- detect if a visitor is on a mobile phone or tablet
- serve different content based on device type
- detect operating system from user agent string
- redirect mobile users to a mobile site
- log device types of website visitors in Express
- check if a user agent is a desktop browser

## When to choose
- you must use User-Agent sniffing for legacy reasons and need a lightweight, dependency-free library
- you need device detection in both browser and Node.js with the same API
- you are maintaining an older codebase that already relies on UA-based detection

## When to avoid
- you can use feature detection (e.g. Modernizr) or CSS media queries instead, which the author recommends
- you need reliable, up-to-date detection of the newest devices, since the regex rules are outdated
- you need the mobile grade feature, which the author says is useless nowadays
- you are starting a new project where responsive design would remove the need for UA sniffing

## Facets
- artifact type: library
- maturity: maintenance
- function: http-server, middleware
- domain: web-development, frontend, developer-tools
- platform: browser
- tags: user-agent-parsing, device-detection, mobile-detection, responsive-design, user-agent-sniffing, nodejs, javascript

## Member repositories
- hgoebl/mobile-detect.js (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:36.230804+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:23:00.215062+00:00, confidence not recorded.
  - readme: https://github.com/hgoebl/mobile-detect.js (fetched 2026-08-28T04:08:36.230804+00:00, sha 9a5f07b5fe45)
  - homepage: http://hgoebl.github.io/mobile-detect.js/ (fetched 2026-08-29T09:14:17.442091+00:00, sha 35cf5777c73b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
