Platform Sniffer

Tailor your content. This script analyzes the system platform to tell you whether your visitor is on a desktop PC, a Mac, or a mobile device.

Your Operating System:
Detecting...

Copy the Script

<script>
var os = "Unknown OS";

if (navigator.userAgent.indexOf("Win") != -1) os = "Windows";
if (navigator.userAgent.indexOf("Mac") != -1) os = "MacOS";
if (navigator.userAgent.indexOf("X11") != -1) os = "UNIX";
if (navigator.userAgent.indexOf("Linux") != -1) os = "Linux";
if (navigator.userAgent.indexOf("Android") != -1) os = "Android";
if (navigator.userAgent.indexOf("iPhone") != -1) os = "iOS";

document.write("Your OS: " + os);
</script>

Frequently Asked Questions

It allows you to show relevant download links (e.g., 'Download for Windows' vs 'Download for Mac') or display OS-specific keyboard shortcuts (Ctrl vs Command).

It is generally accurate for major platforms. However, Linux distributions vary wildly, and some privacy tools spoof the platform string to hide the user's identity.

Yes. You can parse the `navigator.userAgent` string to look for specific keywords like 'iPhone', 'iPad', or 'Android'.