Detect IE8 64bit in Javascript

Christian Engel picture Christian Engel · Feb 17, 2011 · Viewed 7.5k times · Source

Hey there, I just wondered if there is a method to detect if the 64bit or 32bit Version of IE8 is running?

Because there are some major Bugs in the Facebook Javascript SDK which only occure in IE8x64...

Answer

Martin Buberl picture Martin Buberl · Feb 17, 2011

According to this IEBlog post you should be able to read it from the browsers User-Agent string via navigator.userAgent:

Detecting 64-bit Internet Explorer

As machines with more than 4 gigabytes of RAM become more common, more and more users are running 64-bit versions of Windows. For compatibility with 3rd party add-ons, the 32-bit edition of Internet Explorer remains the default on 64-bit systems. However, in some cases it can be useful for websites to recognize when users are visiting using 64-bit systems—for instance, a site may want to know whether to offer a 64-bit executable download.

Tokens in the User-Agent string will enable you to determine whether or not the user is running a 64-bit version of Windows, and whether they are running the 64-bit edition of Internet Explorer.

64-bit IE on 64-bit Windows:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Win64; x64; Trident/4.0)

32-bit IE on 64-bit Windows:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0)

Incidentally, WOW64 stands for “Windows on Windows 64-bit.”