Skip to content

Relative Luminance Calculator

Compute WCAG relative luminance and see the maths behind it.

The colour

Luminance
The value appears here

Quick Tool Overview

The Relative Luminance Calculator computes the number underneath every contrast ratio and shows each step of the formula — gamma expansion per channel, then the 0.2126 / 0.7152 / 0.0722 weighting that makes green carry most of a colour’s brightness.

What it does
Computes WCAG relative luminance, with working
You give it
Any colour
You get back
Luminance, perceptual lightness and every step
Best for
Understanding contrast and checking an implementation
Color Tools Free, unlimited use No sign-up Runs in your browser

About the Relative Luminance Calculator

Relative luminance is the number underneath every contrast ratio: how much light a colour emits, on a scale where black is 0 and white is 1. This tool computes it and shows each step, which is the part the specification text makes hard to follow.

The calculation has two halves. First each sRGB channel is undone from its gamma encoding — the curve that lets 8 bits carry a perceptually even range — using the piecewise formula the sRGB standard defines. Then the three linear channels are weighted and added: 0.2126 red, 0.7152 green, 0.0722 blue.

Those weights are the interesting part, and seeing them makes several colour puzzles obvious at once. Green carries nearly three-quarters of the perceived brightness of a colour and blue less than a thirteenth, which is why pure blue text is so hard to read on black, why yellow feels so bright, and why averaging the three channels is not a usable measure of anything.

Key features of the Relative Luminance Calculator

Every step shown

Each channel before and after gamma expansion, with its weighted contribution to the total.

Luminance and lightness

The physical value and the perceptual one, which differ by roughly a cube root and are constantly confused.

The weights made obvious

Seeing that blue contributes 7% explains why blue text on black is unreadable, in one line.

Contrast from the same value

The ratios against black and white are derived in front of you, so the arithmetic can be checked.

Exact piecewise formula

Implements the sRGB linearisation properly, including the straight-line segment below the threshold.

How to use the Relative Luminance Calculator

  1. 1

    Enter a colour

    Any notation. The channels are read as 0–255 sRGB.

  2. 2

    Read the luminance

    A value from 0 for black to 1 for white, with the perceptual lightness beside it.

  3. 3

    Follow the working

    Each channel is shown before and after gamma expansion, with its weighted contribution.

  4. 4

    Use it for contrast

    The ratio against black and white is computed from the same value, so you can check the arithmetic.

Frequently asked questions

No. Luminance is physical — light emitted. Lightness is perceptual, and roughly the cube root of luminance: a colour with 0.2 luminance looks about half as bright as white, not a fifth. Both are shown here.

Reviews of the Relative Luminance Calculator

What people who use the Relative Luminance Calculator think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the Relative Luminance Calculator. It takes half a minute and no account.

Write the first review

More color tools