hints / ua · default
Sec-CH-UA-Mobile
Sec-CH-UA-Mobile is a boolean client hint sent on every Chromium request: ?1 means the browser prefers a mobile experience, ?0 means it does not.
- Example
Sec-CH-UA-Mobile: ?0- JavaScript
navigator.userAgentData.mobile- Available since
- Chrome 89 (2021)
- Engines
- Chrome Edge Opera Firefox Safari
- References
- MDN · Specification
Sec-CH-UA-Mobile answers exactly one question (should I serve the mobile experience?) in the smallest possible payload: a structured-field boolean.
Sec-CH-UA-Mobile: ?1 # mobile
Sec-CH-UA-Mobile: ?0 # not mobile The ? prefix is not a typo; it is how RFC 8941 structured fields encode booleans on the wire. If your header parser reports the literal strings ?1/?0, use a structured-field parser or compare against those two strings, never against true/false.
What “mobile” means here
The value reflects the browser’s own UI mode, not screen size or touch support:
- Phones report
?1. - Tablets generally report
?0; Android tablets ask for desktop-class layouts. - A user toggling “Request desktop site” flips the value to
?0, and the browser also adjusts the rest of its UA hints to match.
Treat it as a strong preference signal, not ground truth about hardware. Pair it with Sec-CH-UA-Platform to distinguish “Android tablet in desktop mode” from an actual desktop, or request Sec-CH-UA-Form-Factors for finer categories.
In JavaScript
navigator.userAgentData.mobile // true | false Server-side use
Because it is sent by default on the very first request, Sec-CH-UA-Mobile is the cleanest way to pick a mobile layout at the edge or in a CDN worker: no Accept-CH round-trip, no client-side redirect. Remember to emit Vary: Sec-CH-UA-Mobile on responses that depend on it, so shared caches keep the two variants apart. Firefox and Safari never send it; fall back to User-Agent there.