ForHosting KIT · Unit converters

Color depth converter

24 bits per pixel give 16,777,216 colors: convert color depth between bits per pixel, number of colors, bits per channel, bytes per pixel and levels per channel, with the channel count set for RGB, grayscale or RGBA. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Value
24
Source unit
bpp
Target unit
colors
You get
Result
16,777,216
Channels
3
From label
bits per pixel
To label
number of colors

A color depth converter turns a display bit-depth figure written in one unit into another without hunting power-of-two tables or mixing bits-per-pixel with palette size.

Five ways to write the same color depth

Color depth can be written in five units that describe the same thing. Bits per pixel count every bit used for one pixel, and the number of colors is two raised to that figure. Bits per channel split the pixel among its color channels, bytes per pixel group the bits in eights, and levels per channel are two raised to the bits per channel. The converter always passes through bits per pixel, so a conversion and its reverse agree. That is why 24 bits per pixel come out as 16,777,216 colors, 8 bits per channel, 3 bytes per pixel and 256 levels.

Where the channel count matters

Bits per channel and levels per channel depend on how many channels a pixel has. The converter assumes three, for red, green and blue, unless you set another number: one for grayscale and four for RGBA. Forgetting this is the most common mistake, because with four channels the same 24 bits per pixel give 6 bits per channel, not 8. Typical checks come from image format headers, graphics card datasheets, display specifications and homework problems, such as turning 8-bit indexed mode into its 256 colors.

Where color depth figures turn up every day

Use the free in-browser color depth converter when you need a quick bits-per-pixel to number-of-colors check, a true-color eight bits per channel times three channels to twenty-four bpp verification, or a bytes-per-pixel to levels comparison while reading a GPU datasheet, an image format header, a display marketing page, or a homework problem. Open the page, enter the number and units, set channels when needed, and copy the result without installing a spreadsheet, a graphics library, or a desktop calculator pack.

Source inputs follow the same retention rules as other KIT parse items, and results are safe to cache because the algorithm is fully deterministic. Authors shipping mobile apps or chatbots can map the result and formula fields directly into cards that show both the number and the conversion path engineers, support teams, and students expect on paper.

Image formats and GPU datasheets

Convert 24 bpp true color to 8 bits per channel RGB, or 8 bpp indexed mode to 256 colors, when reading headers, marketing specs, and renderer configs.

How do bits per pixel and number of colors relate?

Number of colors equals two raised to the bits-per-pixel power for indexed or total palette depth. For example, 8 bpp is 256 colors, and 24 bpp is 16,777,216 colors.

What is the channels field for?

Channels (default 3 for RGB) links bits per channel and levels per channel to total bits per pixel: bpp equals channels times bpc. Use 1 for grayscale and 4 for RGBA.

What happens if I send an unknown unit?

The message names the field and lists supported units. Validation failures are not charged.

Is the color depth converter free?

The browser tool runs free on your device.

What is the difference between bits per pixel and bits per channel?

Bits per pixel count every bit in one pixel, while bits per channel count only the bits of one color channel. With three RGB channels, 24 bits per pixel are 8 bits per channel, which is what true color means.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/conv/color-depth

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/conv/color-depth \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value":24,"from":"bpp","to":"colors"}'
{
  "value": 24,
  "from": "bpp",
  "to": "colors"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "conv.color_depth",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The browser tool runs free on your device; the prepaid API charges $0.002 per successful item when pipelines need the same contract from servers and automation.

Supported units and how the conversion is computed

The intermediate bits-per-pixel value is then mapped into the target unit with the inverse relations, including exact integer powers of two when the exponent is a whole number within the safe range. An optional channels field defaults to three for RGB and is used whenever bits-per-channel or levels-per-channel participate; send one for grayscale and four for RGBA so channel math matches your pixel layout. Because the intermediate is always bits per pixel, converting A to B and B to A is consistent up to published rounding, and there is no pairwise matrix that can drift out of sync. The converter accepts five color-depth families under stable canonical codes: bpp for bits per pixel, colors for the number of distinct palette or total colors equal to two raised to the bits-per-pixel power, bpc for bits per channel, bytes_pp for bytes per pixel, and levels for levels per channel equal to two raised to the bits-per-channel power. Friendly aliases such as bits per pixel, number of colors, palette size, bits per channel, bytes per pixel, and levels per channel are normalized so forms and APIs can pass either short codes or full names. Every request first maps the input into bits per pixel: colors become log base two of the count, bits per channel multiply by the channel count, bytes per pixel multiply by eight, and levels become log base two of the levels times channels. Unknown unit tokens fail with invalid_input rather than a silent wrong answer, which keeps homework checkers, graphics pipelines, and product UIs honest about bad form values.

Request shape, response fields, and unknown-unit errors

The error message names the bad field and lists the supported set so clients can correct forms without guessing. Twenty-four bit true color, eight bit indexed palettes, and high-bit scientific channels share the same code path, so classroom and production depths remain well-defined under one contract. Send a JSON body with three required fields: value as a finite positive number, from as the source unit string, and to as the target unit string. Aliases amount, quantity, and depth are accepted for value; unit_from and source for from; unit_to and target for to. Optional channels (aliases channel_count and n_channels) is an integer from one through eight and defaults to three. On success the response echoes the canonical from and to codes, human-readable from_label and to_label strings, the converted result, the intermediate bpp quantity, derived colors, bpc, bytes_pp, and levels snapshots for the same pixel depth, the channels used, a short formula line suitable for UI display, the method tag color_depth_bpp, and the fixed list of units_supported. Missing value, non-finite numbers such as NaN or Infinity, non-positive depth quantities, missing unit fields, channels outside one through eight, depths that exceed the safe forty-eight bit intermediate ceiling, and any token that does not map to a supported unit fail with invalid_input and are not charged after the engine rejects the request. Identical inputs always yield identical JSON because the path is pure arithmetic with no randomness, no remote lookup, and no dependence on the wall clock, which makes the endpoint safe to pin in continuous-integration goldens and SDK contract tests.

Browser use, API pricing, and everyday workflows

Switch to the prepaid API when an image-pipeline tool, game-asset validator, display-spec calculator, curriculum checker, or rendering homework service must convert depths at scale under a stable KIT contract at $0.002 per successful item; validation failures that raise invalid_input do not consume balance after rejection. Pair this endpoint with color-space converters when a product pipeline needs both bit depth and hex or RGB values, or call it alone when search traffic is specifically for color-depth conversion—bits per pixel, number of colors, bits per channel, bytes per pixel, and levels—rather than a general unit switchboard.

Game and asset pipelines

Normalize palette size, bytes per pixel, and channel depth across texture tools so asset validators share one prepaid contract with clear invalid_input on bad units.

Classroom and homework checkers

Turn bits-per-pixel, palette colors, and levels-per-channel exercises into a deterministic API students and graders can pin in automated tests.

Which color-depth units does this converter support?

Bits per pixel (bpp), number of colors, bits per channel (bpc), bytes per pixel (bytes_pp), and levels per channel. Full names and common aliases are accepted; unknown units raise invalid_input.

Read the full KIT documentation →