Complementary Color Calculator

Enter a hex color to find its complementary color.

Result

#ffb21e
#e19400
#1e6bff

How it is calculated

The tool reads a hex colour (with or without #; three-digit shorthand such as #f60 is expanded to six digits) and converts it from RGB to HSL: hue, saturation and lightness. The complement keeps saturation and lightness and rotates the hue by half a turn: hue' = (hue + 180°) mod 360°. That HSL value is converted back to RGB and written as a lowercase hex code. A second answer is the RGB invert, 255 − channel for red, green and blue separately. The two usually differ; they match only for some colours, such as pure red. Greys have no hue, so their complement is themselves, while the invert flips them. Codes with the wrong length or non-hex characters give no result.

Worked example

Take #1E6BFF. Its channels are red 30, green 107, blue 255, which in HSL is hue 219.5°, saturation 100% and lightness 55.9%. Add 180° to the hue: 39.5°, an orange. Keep saturation and lightness and convert back, giving red 255, green 178, blue 30. The complement is #ffb21e. The RGB invert is different: 255 − 30 = 225, 255 − 107 = 148, 255 − 255 = 0, which gives #e19400. The original is echoed as #1e6bff.

Try this example →

Common mistakes

  • Expecting the HSL complement and the RGB invert to be the same. For this blue they give a bright orange (#ffb21e) and a darker amber (#e19400), so choose the one your design method calls for.
  • Entering a colour with an alpha pair such as #1E6BFF80. Only 3 or 6 hex digits are accepted, so remove the transparency digits first.
  • Expecting a complement for black, white or grey. They have no hue to rotate, so the complement is the same colour, for example #808080 returns #808080.
  • Treating the result as a finished palette. The complement is a single colour at the same lightness; text on it may still fail a contrast check, so test readability separately.
  • Assuming the traditional painter's wheel gives the same answer. The tool rotates the screen RGB hue, so complements for blue come out orange, not the yellow some art-class wheels teach.

About this calculator

A complementary color is the color diametrically opposite a given hue on the color wheel — pairing them creates the strongest possible contrast, which is why complementary schemes (blue/orange, red/green, yellow/purple) are a foundational tool in design, painting, and branding. This calculator finds it by converting your hex color to HSL (hue, saturation, lightness) and rotating the hue value by 180° while keeping saturation and lightness unchanged, then converting back to hex — the standard color-theory method for finding a true complement.

It also shows the alternative you get from a simple RGB inversion (subtracting each of the red, green, and blue channel values from 255), which produces a visually different result from the HSL-based complement — an RGB invert is the mathematical “negative” of a color, while the HSL hue rotation is the perceptually correct complementary color used in color theory and design tools like Adobe Color.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators