iPad User Agent String

Written by Amit Agarwal on Jul 21, 2012

If you want to know how your website might render inside the Safari browser of Apple iPad, just get the desktop version of Safari and change the user-agent of Safari to that of iPad.

Here’s the full user agent string of iPad

Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10

The User agent string for iPad 2 is (the iOS version has changed):

Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X; en-us) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3

The test navigator.userAgent.indexOf(‘iPad’) detects the iPad device from the User Agent String but you need to look at the screen.width and screen.height for the resolution and that determines where the it’s the 3rd generation iPad.

If you are on the Firefox, the User Agent extension to test the iPad layout on your desktop. There are no extensions for Chrome but you may use this trick to change user agent in Chrome manually.

Alternatively, if you are on the Mac, you can download the iPhone SDK from apple.com and test the website layout using the iPad simulator that comes with the SDK. However, this would require you to join the Apple Developer Program – you’ll get all the documentation, sample code and simulators for developing applications for the iPad, iPhone, and iPod touch but the program costs $99/year.

Subscribe to our Email Newsletter