Navigator.oscpu

The Navigator.oscpu property returns a string that identifies the current operating system.

Syntax

oscpuInfo = navigator.oscpu

Value

A DOMString providing a string which identifies the operating system on which the browser is running.

Operating system oscpuInfo string format
OS/2 OS/2 Warp x (either 3, 4 or 4.5)
Windows CE WindowsCE x.y1
Windows 64-bit (64-bit build) Windows NT x.y; Win64; x64
Windows 64-bit (32-bit build) Windows NT x.y; WOW64
Windows 32-bit Windows NT x.y
Mac OS X (PPC build) PowerPC Mac OS X version x.y
Mac OS X (i386/x64 build) Intel Mac OS X or macOS version x.y
Linux 64-bit (32-bit build) Output of uname -s plus "i686 on x86_64"
Linux Output of uname -sm
  1. x.y refers to the version of the operating system

Example

function osInfo() {
  alert(window.navigator.oscpu);
}

osInfo(); // alerts "Windows NT 6.0" for example

Usage notes

Unless your code is privileged (chrome or at least has the UniversalBrowserRead privilege), it may get the value of the general.oscpu.override preference instead of the true platform.

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'NavigatorID: oscpu' in that specification.
Living Standard Initial definition

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
oscpu
DeprecatedNon-standard
Chrome No support NoEdge No support NoFirefox Full support Yes
Notes
Full support Yes
Notes
Notes The preference "general.oscpu.override" can be used to set a value to be returned instead of the true CPU description. The preference setting is ignored for calls made by privileged code, which continue to get the actual CPU description.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support YesOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

Full support
Full support
No support
No support
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.
See implementation notes.
See implementation notes.