X-UA-Compatible

The HTTP X-UA-Compatible header is an optional and unofficial HTTP header, used to provide special instruction to the Internet Explorer browser family concerning which document type to use.

Note

As of Internet Explorer 11, which itself was replaced by Microsoft Edge, document types are deprecated and this HTTP header is no longer used.

Usage

The possible values for X-UA-Compatible are:

  • IE=edge Specifying edge mode instructs Internet Explorer to render and display content in the highest mode that is available. If Internet Explorer 9 is being used, then it is equivalent to IE9 mode. Starting with IE11, edge mode is the preferred document mode.

  • IE=11 Specifying IE11 mode provides the highest support available for both established and emerging industry standards. These include HTML5, CSS3 and more.

  • IE=EmulateIE11

  • IE=10 Specifying IE10 mode provides the highest support available for both established and emerging industry standards. These include HTML5, CSS3 and more.

  • IE=EmulateIE10

  • IE=9 Specifying IE9 mode provides the highest support available for both established and emerging industry standards. These include HTML5 (working draft), CSS3 (working draft; does not support CSS3 animations), Scalable Vector Graphics (SVG) 1.0 and more.

  • IE=EmulateIE9 Specifying EmulateIE9 instructs the browser to use the <!DOCTYPE> directive to determine how the content shall be rendered. The standards mode directives are rendered in IE9 mode, whereas quirks mode directives are displayed in IE5 mode. The difference between IE9 mode and EmulateIE9 mode is that the latter adheres to the <!DOCTYPE> directive.

  • IE=8 Specifying IE8 mode provides support for many existing standards. These include CSS 3.1, the W3C Selectors API, limited support for CSS3 (working draft), and other emerging standards.

  • IE=EmulateIE8 Specifying EmulateIE8 instructs the browser to use the <!DOCTYPE> directive to determine how the content shall be rendered. The standards mode directives are rendered in IE8 mode, whereas quirks mode directives are displayed in IE5 mode. The difference between IE8 mode and EmulateIE8 mode is that the latter adheres to the <!DOCTYPE> directive.

  • IE=7 When IE7 mode is specified, the browser renders content as if it were in standards mode as specified by Internet Explorer 7, whether or not the content includes a <!DOCTYPE> directive.

  • IE=EmulateIE7 Specifying EmulateIE7 instructs the browser to use the <!DOCTYPE> directive to determine how the content shall be rendered. The standards mode directives are rendered in IE7 mode, whereas quirks mode directives are displayed in IE5 mode. The difference between IE7 mode and Emulate IE7 mode is that the latter adheres to the <!DOCTYPE> directive.

  • IE=5 Specifying IE5 mode displays content the same way according to quirks mode with Internet Explorer 7. This is similar to how content was rendered by Microsoft Internet Explorer 5.

Note

The "X-" naming convention for HTTP headers, "X" referring to "experimental", has been deprecated and need to be transitioned to formal naming convention for HTTP headers.

Example

Response

X-UA-Compatible: IE=edge

The X-UA-Compatible header can also be added to the HTML source code of a URL as a meta tag, for example:

<meta http-equiv=”X-UA-Compatible” content=”IE=edge”>

Takeaway

The X-UA-Compatible specifies a particular document type to be used by the family of Internet Explorer browsers. Unless you are supporting a legacy system that uses IE8 or IE9, this header is to be avoided.

See also

Last updated: June 20, 2022