Color average calculator

Paste a list of colors, one per line or separated by commas, and see their average calculated in three color spaces. The three answers differ, and the notes explain why.

HEX (#ff0000 or ff0000), rgb(), hsl() or oklch(), one per line or separated by commas.

Average in sRGB

#800080

The mean of the stored red, green and blue values. This is what most tools do; mixes tend to look darker than expected.

Average in linear RGB

#bc00bc

The values are converted to linear light first, as if the colors were lights added together, then averaged. Results are lighter.

Average in OKLab

#8c53a2

The mean of lightness and the two color axes of OKLab, which is built to match human perception. Usually the most natural-looking average.

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Enter colors, one per line or separated by commas. Pasting #ff0000, #0000ff works.
  2. Read the three averages. Each has a swatch, a HEX code and a Copy button.

How the three averages work

sRGB. Add the red values, divide by the count; same for green and blue. Red #ff0000 and blue #0000ff give #800080, because (255 + 0) / 2 = 127.5, rounded to 128.

Linear RGB. Each channel is first converted to linear light with the sRGB transfer function, averaged, and converted back. Red and blue now give #bc00bc: the linear value (1 + 0) / 2 = 0.5 becomes 188 after the curve.

OKLab. Colors are converted to OKLab, where L is lightness and a and b are color axes. The three numbers are averaged and converted back. The result is clipped to the sRGB range if it falls outside.

Worked example

Black and white: sRGB gives mid grey #808080, linear RGB gives the lighter #bcbcbc (half the light), and OKLab gives the darker #636363, because the midpoint of OKLab lightness is 0.5, which corresponds to only 12.5% of linear light.

Frequently asked questions

Why are there three different averages?

Colors are stored with a gamma curve, so the numbers are not proportional to light. Averaging the stored values (sRGB) is simple. Averaging after undoing the curve (linear RGB) treats colors as light. OKLab averages in a space designed so that equal steps look equal to the eye. For black and white they give #808080, #bcbcbc and #636363.

Which one should I use?

Use sRGB when you need to match what other software (CSS, image editors) reports. Use OKLab for the most natural-looking blend. Use linear RGB when you are simulating light, for example blurring or downscaling an image correctly.

Which color formats can I paste?

HEX with or without #, three or six digits, and rgb(), hsl(), hsv(), cmyk() and oklch() functions. Names such as "red" are not recognised. Entries that are not colors are counted and ignored.

Is the average of an image the same as the average of its colors?

Only if every color appears equally often. This tool treats each listed color as one equal vote; repeat a color on several lines to give it more weight.

More in Color

All tools in this category: Color ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.