CancelImage Upload

How to find out a screen's bit depth color pallete using JavaScript

To find out what the bit depth of a visitors screen is using JavaScript you will need to use the following code:

var depth = screen.colorDepth;

Here is a more complete example of this information being loaded into a span via getElementById():

<title>Load Screen Color Depth</title>

<script language="JavaScript">

function loadDepth()

        var colorDepth = document.getElementById("colorDepth");

        var depth = screen.colorDepth;

        colorDepth.innerHTML = "Bit depth: " + depth;



<body onload="javascript:loadDepth();">

<span id="colorDepth"></span>


Want to leave a comment?

No problem. Just enter your email and password below.

register | home | reminder

myDesignTool Networking •