change in the future.

The **` DPR ` ** [ device client hint ](/en-US/docs/Web/HTTP/Client_hints)
request header provides the client device pixel ratio. This ratio is the
number of physical device pixels corresponding to every [ CSS pixel ](/en-
US/docs/Glossary/CSS_pixel) .

Header type  |  [ Request header ](/en-US/docs/Glossary/Request_header) , [ Client hint ](/en-US/docs/Web/HTTP/Client_hints)  
---|---  
[ Forbidden header name ](/en-US/docs/Glossary/Forbidden_header_name) |  no   
  
The hint is useful when selecting image sources that best correspond to a
screen's pixel density. This is similar to the role played by ` x `
descriptors in the ` <img> ` [ ` srcset ` ](/en-
US/docs/Web/HTML/Element/img#srcset) attribute to allow user agents to select
a preferred image.

If a server uses the ` DPR ` hint to choose which resource is sent in a
response, the response must include the [ ` Content-DPR ` ](/en-
US/docs/Web/HTTP/Headers/Content-DPR) header. The client must use the value in
` Content-DPR ` for layout if it differs from the value in the request's ` DPR
` header.

If the ` DPR ` header appears more than once in a message the last occurrence
is used.

**Note:**

  * Client Hints are accessible only on secure origins (via TLS). 
  * A server has to opt in to receive the ` DPR ` header from the client, by sending the [ ` Accept-CH ` ](/en-US/docs/Web/HTTP/Headers/Accept-CH) response header. 
  * Servers that opt in to the ` DPR ` client hint will typically also specify it in the [ ` Vary ` ](/en-US/docs/Web/HTTP/Headers/Vary) header. This informs caches that the server may send different responses based on the header value in a request. 
  * ` DPR ` was removed from the client hints specification in [ draft-ietf-httpbis-client-hints-07 ](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-client-hints-07) . The proposed replacement is [ ` Sec-CH-DPR ` ](https://wicg.github.io/responsive-image-client-hints/#sec-ch-dpr) (Responsive Image Client Hints). 

##  Syntax

http

    
    
    DPR: <number>
    

##  Directives

` <number> `

    

The client device pixel ratio.

##  Examples

A server must first opt in to receive the ` DPR ` header by sending the
response header [ ` Accept-CH ` ](/en-US/docs/Web/HTTP/Headers/Accept-CH)
containing the directive ` DPR ` .

http

    
    
    Accept-CH: DPR
    

Then on subsequent requests the client might send ` DPR ` header to the
server:

http

    
    
    DPR: 2.0
    

If a request with the ` DPR ` header (as shown above) is for an image
resource, then the server response must include the [ ` Content-DPR ` ](/en-
US/docs/Web/HTTP/Headers/Content-DPR) header:

http

    
    
    Content-DPR: 2.0
    

##  Browser compatibility

BCD tables only load in the browser  with JavaScript enabled. Enable
JavaScript to view data.

##  See also

  * [ Improving user privacy and developer experience with User-Agent Client Hints ](https://developer.chrome.com/docs/privacy-security/user-agent-client-hints) (developer.chrome.com) 
  * Device client hints 
    * [ ` Content-DPR ` ](/en-US/docs/Web/HTTP/Headers/Content-DPR)
    * [ ` Device-Memory ` ](/en-US/docs/Web/HTTP/Headers/Device-Memory)
    * [ ` Viewport-Width ` ](/en-US/docs/Web/HTTP/Headers/Viewport-Width)
    * [ ` Width ` ](/en-US/docs/Web/HTTP/Headers/Width)
  * [ ` Accept-CH ` ](/en-US/docs/Web/HTTP/Headers/Accept-CH)
  * [ HTTP Caching > Vary ](/en-US/docs/Web/HTTP/Caching#vary) and [ ` Vary ` ](/en-US/docs/Web/HTTP/Headers/Vary)

##  Help improve MDN

Was this page helpful to you?

Yes  No

[ Learn how to contribute
](https://github.com/mdn/content/blob/main/CONTRIBUTING.md "This will take you
to our contribution guidelines on GitHub.") .

This page was last modified on  Dec 10, 2023  by  [ MDN contributors ](/en-
US/docs/Web/HTTP/Headers/DPR/contributors.txt) .

[ View this page on GitHub
](https://github.com/mdn/content/blob/main/files/en-
us/web/http/headers/dpr/index.md?plain=1 "Folder: en-us/web/http/headers/dpr