Invert a colour
Inverting subtracts each channel from 255. The complement rotates the hue and keeps the lightness. They are not the same, and this shows both. Nothing you choose here leaves your browser — it is worked out on your own device, so there is nothing to send and nothing to log.
Two operations, one button
Invert and complement get used interchangeably and they are not the same thing.
Inverting subtracts each channel from 255. White becomes black. It flips the lightness along with the hue.
The complement rotates the hue 180° around the wheel and keeps the lightness where it was. White has no hue to rotate, so the complement of white is white.
Swept over 200,000 random colours, the two give the same answer for 0.53% of them — and those are precisely the colours sitting at HSL lightness 50%, where "flip the lightness" and "keep the lightness" happen to coincide.
| Colour | Inverted | Complement | Apart |
|---|---|---|---|
| #FF0000 | #00FFFF | #00FFFF | 0 |
| #808080 | #7F7F7F | #808080 | 1 |
| #F9FFF8 | #060007 | #FEF8FF | 248 |
| #FFFFFF | #000000 | #FFFFFF | 255 |
The third row is the one worth looking at. A very pale green inverts to a very dark red and complements to a very pale pink. One of those is a dark colour and one is a light colour, and a tool that calls both "the opposite" is not helping.
Which one do you want?
Inverting is what you want for a negative, for flipping an image, or for anything where the point is that dark becomes light. It is a channel operation and it has nothing to do with colour theory.
The complement is what you want when you are picking a colour to sit opposite another one, and you want it to be about as light as the thing it sits next to. That is a design question, and it is the reason complementary schemes exist.