Dark-mode drafts
Flip a light surface color to its negative for a starting dark palette, then tune the mid tones. The inverted value keeps the same channel spread, so the tint survives the switch.
Turn any hex color into its exact negative. Each 8-bit channel becomes 255 minus itself, so #1a73e8 comes back as #e58c17. Type a value, compare both swatches, then copy the hex or the rgb() pair.
Convert
Accepts 3-digit and 6-digit hex, with or without the hash. The negative updates as you type.
Try a preset
Original
rgb(26, 115, 232)
Inverted negative
rgb(229, 140, 23)
Inversion: #1a73e8 → #e58c17
Parsing and subtraction run in this browser tab; the color is never uploaded.
The math
A hex pair is one channel: two hexadecimal digits between 00 and FF. Inversion subtracts that channel from FF, which is exactly what an image editor does to a pixel — one channel at a time.
#RRGGBB → #(FF−RR)(FF−GG)(FF−BB)Three steps
Split the hex value into red, green and blue.
Subtract each channel from 255 (FF in hexadecimal).
Convert the three results back into hex digits.
Reference table
Worked examples you can verify by hand. Mid gray is the interesting case: 128 inverts to 127, so no gray is its own inverse in 8-bit color.
| Original | RGB | Inverted | RGB |
|---|---|---|---|
| #000000 | rgb(0, 0, 0) | #ffffff | rgb(255, 255, 255) |
| #ff0000 | rgb(255, 0, 0) | #00ffff | rgb(0, 255, 255) |
| #1a73e8 | rgb(26, 115, 232) | #e58c17 | rgb(229, 140, 23) |
| #d8ff3e | rgb(216, 255, 62) | #2700c1 | rgb(39, 0, 193) |
| #808080 | rgb(128, 128, 128) | #7f7f7f | rgb(127, 127, 127) |
| #f05a28 | rgb(240, 90, 40) | #0fa5d7 | rgb(15, 165, 215) |
Why it matters
Four jobs where the exact negative value beats eyeballing a color picker.
Flip a light surface color to its negative for a starting dark palette, then tune the mid tones. The inverted value keeps the same channel spread, so the tint survives the switch.
Text drawn in color A on background B reads the same way as text in B on A. Inverting both keeps the lightness gap intact, which makes inverted pairs a quick legibility test.
Print, poster and sticker work often asks for the photographic negative of an accent color. The inverted hex is that exact value rather than a close approximation.
filter: invert(1) on an element produces the same negative as inverting the hex values behind it. When the two disagree, one of them is not a pure inversion.
Know the difference
Three operations that look identical in a screenshot and do different things to your files.
| Method | What it reverses | What it leaves alone |
|---|---|---|
| HEX inversion (this page) | A single color value: R, G and B each become 255 minus themselves. | Pixels, files and alpha — there is nothing here but arithmetic on a color code. |
| Image color inversion | Every pixel of a PNG, JPEG, WebP or BMP, processed in the browser. | Canvas size, pixel positions and the alpha channel of a transparent PNG. |
| CSS filter: invert(1) | How the browser paints an element at render time, including its text. | The color values in your stylesheet and the pixels in the original image file. |
The color whose red, green and blue channels each add up to 255 with the original. #000000 inverts to #ffffff, #ff0000 to #00ffff, and #1a73e8 to #e58c17.
No. A color-wheel complement rotates hue by 180 degrees and keeps lightness and saturation. Channel inversion works in RGB and reverses lightness too, which is why a dark blue comes back as a light warm orange.
#808080 is 128 per channel, and 255 − 128 is 127, so it becomes #7f7f7f. A value that inverts to itself would have to be 127.5, and an 8-bit channel only holds whole numbers.
Not on this page. Hex codes carry no alpha channel, so there is nothing to reverse. The image inverter processes RGB only and leaves PNG transparency untouched.
Yes. #0af is expanded to #00aaff before the subtraction, so it inverts to #ff5500. Short and long forms always produce the same result.
No. The input is parsed and inverted by JavaScript running in your browser, and nothing is stored or logged.
Inverting a color code and inverting a picture are different jobs — pick the one that matches your file.
Run the same 255 − x math on every pixel of a PNG, JPEG, WebP or BMP and download the negative.
Invert an imageClassic Invert, Smart Invert and inverting a photo itself, with the difference between them.
Read the guideThe Invert command, channel-level inversion and when a negative film scan needs more than that.
Read the guideNext step
When the job is a photograph, sprite sheet or logo file rather than one color value, the image inverter applies this same channel math to every pixel and gives you back a full-resolution PNG, JPG or WebP.