Screen pixelDepth Property

## JavaScript Reference

Overview

## JavaScript Objects

JS Array JS Boolean JS Date JS Math JS Number JS String JS RegExp JS Global

## Browser Objects

Window Navigator Screen History Location

## HTML DOM Objects

DOM Document DOM Elements DOM Attributes DOM Events

## HTML Objects

DOM Anchor DOM Area DOM Base DOM Body DOM Button DOM Form DOM Frame/IFrame DOM Frameset DOM Image DOM Input Button DOM Input Checkbox DOM Input File DOM Input Hidden DOM Input Password DOM Input Radio DOM Input Reset DOM Input Submit DOM Input Text DOM Link DOM Meta DOM Object DOM Option DOM Select DOM Style DOM Table DOM td / th DOM tr DOM Textarea

# Screen pixelDepth Property

Screen Object

## Example

Return the color resolution of your screen:

var x = "Color Resolution: " + screen.pixelDepth;
document.getElementById("demo").innerHTML=x;

The result of x will be:

Try it yourself »

## Definition and Usage

The pixelDepth property returns the color resolution (in bits per pixel) of the visitor's screen.

## Browser Support

The pixelDepth property is supported in Internet Explorer 10, Firefox, Opera, Chrome, and Safari.

Note: The pixelDepth property is not supported in Internet Explorer 9 and earlier versions.

Tip: The colorDepth property represents the same thing as the pixelDepth property. Since all major browsers support colorDepth, use that property instead.

## Syntax

screen.pixelDepth

## Return Value

Type | Description
--- | ---

Number

The color resolution, in bits per pixel. Possible values:

- 1 bit per pixel
- 4 bits per pixel
- 8 bits per pixel
- 15 bits per pixel
- 16 bits per pixel
- 24 bits per pixel
- 32 bits per pixel
- 48 bits per pixel

## More Examples

All screen properties in one example

Screen Object

## Your suggestion:

Your E-mail (optional):

Page address:

Description:

Close [X]

## Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

## WEB HOSTING

Best Web Hosting UK Reseller Hosting Wow! $5 SSD Hosting

## WEB BUILDING

Download XML Editor
FREE Website BUILDER FREE Website Creator

## WEB RESOURCES

Web Statistics Web Validation

## SHARE THIS PAGE