Short answer
The hex code for red is #ff0000, which is rgb(255, 0, 0) in the CSS named-color table. That keyword is one of 16 basic colors. Darker names such as darkred and maroon, and lighter names such as salmon, are separate rows. CMYK, HSL, and the contrast ratios below are computed from those sRGB values.
Last verified against the sources listed below.
Key takeaways
- CSS keyword red is #ff0000, rgb(255, 0, 0). The keyword is ASCII case-insensitive.
- darkred is #8b0000, maroon is #800000, firebrick is #b22222, and crimson is #dc143c.
- CMYK and HSL in the table are computed from the sRGB triples. They are not a press proof.
- Computed contrast for #ff0000 on white is 4.00:1, short of the 4.5:1 AA bar for normal text.
- On black, the same red computes to 5.25:1, which clears 4.5:1 for normal text.
- The spec standardizes names such as indianred because they are widespread, and it does not encourage their use.
A direct answer to what is the hex code for red is the CSS keyword in the named-color table. CSS Color Module Level 4, a W3C Candidate Recommendation Draft dated 1 December 2026, sets red to #ff0000 and the decimal channels 255, 0, 0.
Those channels are sRGB. The same draft says the names resolve to colors in sRGB, and the ICC sRGB registry identifies that encoding as IEC 61966-2-1:1999, with 8-bit depth listed and other depths allowed. Uppercase #FF0000 is the same six digits.
What is the hex code for red?
The hex code for red is #ff0000, which is rgb(255, 0, 0).
A hex color is three pairs after the hash. The first pair is red, the second is green, and the third is blue. In #ff0000 the red pair is ff, the maximum 8-bit value, and the other pairs are 00. Nothing in the green or blue channels is turned on.
MDN’s named-color page puts red in the basic 16, next to black, white, maroon, and the other VGA names the W3C lists: aqua, blue, fuchsia, gray, green, lime, navy, olive, purple, silver, teal, and yellow. MDN then lists about 150 further keywords. The spec says those keywords are ASCII case-insensitive.
You can write the keyword red, the hex, or the rgb() function. All three point at the same row. Hex is what you paste into a tool that has no keyword field. The Red Color Code tool copies that hex and nearby values in the browser.
Channel order is the RGB model: red, then green, then blue. Swapping the first pair with the third pair produces blue, #0000ff, not a shade of red.
Which named reds are in the spec?
The spec lists many reds, and each keyword has its own hex and decimal RGB.
The draft says the 16 basic names came from the VGA palette by way of HTML, and that most of the rest came from one version of the X11 colors later adopted into SVG. It also says the names are standardized because they are widespread, not because they are evenly spaced or easy to picture. darkgray is lighter than gray in that table. Treat every row below as its own color.
| Shade | HEX | RGB | CMYK | HSL |
|---|---|---|---|---|
| red | #ff0000 | 255, 0, 0 | 0, 100, 100, 0 | 0, 100%, 50% |
| darkred | #8b0000 | 139, 0, 0 | 0, 100, 100, 45 | 0, 100%, 27% |
| maroon | #800000 | 128, 0, 0 | 0, 100, 100, 50 | 0, 100%, 25% |
| firebrick | #b22222 | 178, 34, 34 | 0, 81, 81, 30 | 0, 68%, 42% |
| crimson | #dc143c | 220, 20, 60 | 0, 91, 73, 14 | 348, 83%, 47% |
| indianred | #cd5c5c | 205, 92, 92 | 0, 55, 55, 20 | 0, 53%, 58% |
| lightcoral | #f08080 | 240, 128, 128 | 0, 47, 47, 6 | 0, 79%, 72% |
| salmon | #fa8072 | 250, 128, 114 | 0, 49, 54, 2 | 6, 93%, 71% |
| darksalmon | #e9967a | 233, 150, 122 | 0, 36, 48, 9 | 15, 72%, 70% |
| lightsalmon | #ffa07a | 255, 160, 122 | 0, 37, 52, 0 | 17, 100%, 74% |
| tomato | #ff6347 | 255, 99, 71 | 0, 61, 72, 0 | 9, 100%, 64% |
| coral | #ff7f50 | 255, 127, 80 | 0, 50, 69, 0 | 16, 100%, 66% |
| orangered | #ff4500 | 255, 69, 0 | 0, 73, 100, 0 | 16, 100%, 50% |
| palevioletred | #db7093 | 219, 112, 147 | 0, 49, 33, 14 | 340, 60%, 65% |
HEX and RGB are the values printed in the W3C table. CMYK percentages and HSL are computed from those sRGB channels and rounded to the nearest whole number. There is no single official hex for a name that is not in this table, such as cherry.
crimson is not a darker red. Its computed hue is 348 degrees, so a little blue is in the mix. orangered keeps a computed hue of 16 degrees and lightness of 50%, the same lightness as pure red, with the green channel at 69.
How are CMYK and HSL computed?
CMYK and HSL on this page are computed from the sRGB triple, then rounded.
Divide each channel by 255. Black (K) is 1 minus the largest channel. If K is not 1, cyan, magenta, and yellow are the remaining gap on the red, green, and blue channels, divided by (1 minus K).
For rgb(255, 0, 0) that math is exact: 0% cyan, 100% magenta, 100% yellow, 0% black. A printer profile can still shift the ink.
HSL lightness is the average of the largest and smallest channel. Saturation compares the gap between those channels with the room around the lightness. Hue is 0 when red is the largest channel and green equals blue. It moves toward yellow as green rises, which is why tomato computes to 9 degrees and coral to 16.
The editor’s draft carries the same named-color table as the dated Candidate Recommendation. Use the TR when you need a dated snapshot. The draft is where the working group edits next.
Paint mixing is a different problem from a screen keyword. What colors make red covers that mix. A stylesheet still needs a hex or a keyword if the pixel has to match the spec.
Which reds pass contrast on white?
#ff0000 on white computes to 4.00:1, which is under the 4.5:1 AA bar for normal text.
WCAG 2.2, a W3C Recommendation dated 12 December 2024, sets that 4.5:1 minimum for text and images of text. Large-scale text can go to 3:1. Level AAA raises normal text to 7:1 and large text to 4.5:1.
The ratios below use the sRGB relative-luminance formula in that spec: linearized channels weighted 0.2126 red, 0.7152 green, and 0.0722 blue, then (lighter + 0.05) divided by (darker + 0.05). White has luminance 1 and black has luminance 0. Ratios are rounded to two decimals.
| Shade | On white | On black | Normal text on white |
|---|---|---|---|
| red | 4.00:1 | 5.25:1 | Under 4.5:1 |
| darkred | 10.01:1 | 2.10:1 | Clears 7:1 |
| maroon | 10.95:1 | 1.92:1 | Clears 7:1 |
| firebrick | 6.68:1 | 3.14:1 | Clears 4.5:1, under 7:1 |
| crimson | 4.99:1 | 4.21:1 | Clears 4.5:1, under 7:1 |
| indianred | 3.98:1 | 5.28:1 | Under 4.5:1 |
| orangered | 3.44:1 | 6.10:1 | Under 4.5:1 |
| tomato | 2.95:1 | 7.13:1 | Under 3:1 |
| lightcoral | 2.59:1 | 8.10:1 | Under 3:1 |
| salmon | 2.50:1 | 8.40:1 | Under 3:1 |
| coral | 2.50:1 | 8.40:1 | Under 3:1 |
| palevioletred | 3.11:1 | 6.75:1 | Under 4.5:1 |
| darksalmon | 2.31:1 | 9.11:1 | Under 3:1 |
| lightsalmon | 1.99:1 | 10.56:1 | Under 3:1 |
Pure red clears the large-text bar on white and the normal-text bar on black. It does not clear AAA on either background. darkred and maroon clear AAA on white and fail even the 3:1 large-text bar on black.
Pale names such as lightsalmon need dark text. salmon and coral compute to the same 2.50:1 on white even though their hex codes differ, because contrast uses luminance, not the name.
Check the pair, not the swatch alone. A button fill of #ff0000 with white type is the 4.00:1 pair. The same fill with black type is the 5.25:1 pair.
What mistakes change the red?
A shorter hex, a swapped channel, or a different keyword will not match the spec row for red.
The W3C hex section says a 3-digit form duplicates each digit, so #123 is the same color as #112233. That makes #f00 the same opaque color as #ff0000. The same section counts 4,096 colors in the 3-digit syntax and about 17 million in the 6-digit syntax.
An 8-digit form adds alpha. The spec says #ff000080 and rgb(255 0 0 / 50%) are not equivalent, because 128 / 255 is 0.50196…, not one half.
maroon is one of the original 16, and people still type it when they mean pure red. Its hex is #800000, half the red channel, and its computed contrast on white is 10.95:1. That is a darker color with a different job. brown is also in the spec, at #a52a2a, and it is not in the table above because it is not one of the red keywords.
Putting the green channel in front is the other common slip. #00ff00 is lime, not a tint of red. Read the pairs left to right before you ship the file.
Frequently asked questions
Is #FF0000 different from #ff0000?
No. MDN's hex-color page calls each channel a case-insensitive hexadecimal number, so #FF0000 and #ff0000 are the same sRGB color. The named-color table prints the lowercase form #ff0000 for red. The keyword red is also ASCII case-insensitive, so RED and Red point at that row. A design tool that stores uppercase hex is still holding the spec color.
Why is pure red not only red ink in CMYK?
The computed mix for rgb(255, 0, 0) is 0% cyan, 100% magenta, 100% yellow, and 0% black. Cyan would add a blue-green component this pixel does not have. Magenta and yellow together make the red. A real press profile can shift that mix, so treat the percentages as a screen-to-ink starting point.
Does indianred match a single pigment?
The CSS table defines indianred as #cd5c5c, rgb(205, 92, 92). The spec mentions the name's history and says some historical names have been found offensive, so their use is not encouraged. The numeric row is still part of the standard because the keyword has been implemented for years. Prefer the hex when the name itself is a problem.
What is large text for the 3:1 exception?
WCAG 2.2 defines large-scale text as at least 18 point, or 14 point bold, or a CJK size that yields an equivalent size. That exception lowers the contrast bar from 4.5:1 to 3:1. It does not change the computed ratio of a color pair. A red that computes under 3:1 still fails the large-text exception.
Are tomato and orangered official CSS colors?
Yes. Both appear in the CSS Color Module Level 4 named-color table. tomato is #ff6347, rgb(255, 99, 71). orangered is #ff4500, rgb(255, 69, 0). They are not synonyms for red. Each has its own hue, so a stylesheet that says tomato will not render as #ff0000.
Sources
- CSS Color Module Level 4 · W3C, 2026
- named-color · MDN, 2026
- Web Content Accessibility Guidelines (WCAG) 2.2 · W3C, 2024
- CSS Color Module Level 4, Editor's Draft · CSS Working Group, 2026
- sRGB · International Color Consortium, 1999
- hex-color · MDN, 2026