Navigator: oscpu property

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

Value

A string 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.y
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 followed by i686 on x86_64
Linux Output of uname -sm

In this table x.y refers to the version of the operating system

Examples

js
function osInfo() {
  alert(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
HTML
# dom-navigator-oscpu

Browser compatibility

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Node.js
oscpu
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 1 (Release date: 2004-11-09)
footnote
footnote 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.
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote
footnote 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.
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
Node.js – No support
Node.js
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.