J-Kit
Português

detect mobile tablet user agent

Detect mobile and tablet from User-Agent

Differentiating mobile from desktop via User-Agent is necessary for responsive layout debugging, device analytics and conditional redirects. This page explains the heuristics and shows examples of popular device UAs.

Device detection heuristics

  • iPhone: "iPhone" token. iPad: "iPad" (but with iPadOS 13+ Safari UA mimics macOS). Android mobile: "Android" + "Mobile". Android tablet: "Android" without "Mobile". These patterns are conventions, not standards — any app can send any UA.

Popular device UAs

iPhone (iOS 17)

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
Expected output
Mobile · iPhone · iOS 17 · Safari 17

iOS 17 simplified the Safari UA, removing sub-versions.

Safe use

Input
context + tool result
Expected output
interpreted with limits and next steps

Use the result as technical or educational support, keeping the tool limits explicit in the workflow.

Full tool FAQ

It is an HTTP header sent by the browser with every request, in the format: "BrowserName/Version (OS; Architecture) Compatibility/1.0 Engine/Version". The syntax is defined by RFC 7231 and was originally created so servers could adapt responses for different clients.

Frequently asked questions

Why does the iPad look like a Mac in the UA?

With the launch of iPadOS 13 (2019), Apple changed Safari on iPad to report a UA identical to macOS, so that desktop websites would work correctly on iPad. To detect the iPad, you need to check navigator.maxTouchPoints or use UA Client Hints.

Does this page replace official or professional review?

No. It helps explain the scenario and use the tool more safely, but real decisions should consider official sources, full context and qualified guidance when needed.