Skip to content

Basic HTML and CSS color

Red #FF0000

Red (CSS keyword red) has the hex code #FF0000 and the RGB value rgb(255, 0, 0): a medium, vivid red.

Red#FF0000

Red (#ff0000) is the pure sRGB red primary and one of the 16 original HTML colors. Its contrast with white is only 3.99:1, so it fails WCAG AA for normal-size text.

Color codes for Red

Color codes for Red
CSS keywordred
HEX#FF0000
RGBrgb(255, 0, 0)
HSLhsl(0, 100%, 50%)
HWBhwb(0 0% 0%)
OKLCHoklch(62.8% 0.258 29.2)
CMYK (naive, no ICC profile)cmyk(0%, 100%, 100%, 0%)
Decimal16,711,680
Hue familyReds

Contrast and accessibility

On red, black text has a contrast ratio of 5.25:1 and passes AA for normal text; white text reaches 3.99:1.

WCAG 2.2 contrast ratios (success criteria 1.4.3 and 1.4.6: AA needs 4.5:1 for normal text and 3:1 for large text, AAA needs 7:1 and 4.5:1). APCA Lc is the lightness contrast from the APCA-W3 0.0.98G model proposed for WCAG 3; a higher absolute value is more readable, and Lc 75 is its suggested minimum for body text.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on red5.25:1PassPassFailPass40.0
White text on red3.99:1FailPassFailFail−69.6
Red text on white3.99:1FailPassFailFail64.1
Red text on black5.25:1PassPassFailPass−37.5

Tints and shades

Each step mixes red with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, red, white 25%) in CSS.

Tints (mixed with white)

  1. 5%
    #ff0d0d
  2. 15%
    #ff2626
  3. 25%
    #ff4040
  4. 35%
    #ff5959
  5. 45%
    #ff7373
  6. 55%
    #ff8c8c
  7. 65%
    #ffa6a6
  8. 75%
    #ffbfbf
  9. 85%
    #ffd9d9
  10. 95%
    #fff2f2

Shades (mixed with black)

  1. 5%
    #f20000
  2. 15%
    #d90000
  3. 25%
    #bf0000
  4. 35%
    #a60000
  5. 45%
    #8c0000
  6. 55%
    #730000
  7. 65%
    #590000
  8. 75%
    #400000
  9. 85%
    #260000
  10. 95%
    #0d0000

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, red's complementary color is #009CB2 (close to cadetblue), its analogous colors are #F50084 and #D06800, and its triadic partners are #00A836 and #5577FF. For text on top, black gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#009cb2
Analogous−30°, +30°#f50084#d06800
Triadic+120°, +240°#00a836#5577ff
Split-complementary+150°, +210°#00a28a#0092e2

Computed in OKLCH: the hue is rotated by 180° (complementary), ±30° (analogous), ±120° (triadic) and 180° ±30° (split-complementary) while lightness and chroma stay fixed. Results that fall outside sRGB are brought back with the CSS Color 4 gamut mapping algorithm. Because this uses OKLCH, the values differ from tools that rotate hue in HSL, but every color keeps the same perceived lightness.

Warm or cool?

Red is a warm color: its hue is 0° on the HSL wheel, in the red, orange and yellow range (0° to about 70°, plus reds above 330°) that is conventionally called warm.

Nearest named and Tailwind colors

Distance is ΔE OK, the Euclidean distance in OKLab multiplied by 100. Values under about 2 are hard to tell apart side by side.

Nearest CSS named colors

Nearest CSS named colors
ColorHEXΔE OK
orangered#ff45005.0
crimson#dc143c7.7
tomato#ff63479.3

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
red-500#fb2c362.8
red-600#e7000b5.3
rose-500#ff20566.0

Code snippets

CSS
.element {
  color: red;
  background-color: #ff0000;
  border-color: rgb(255 0 0);
  outline-color: oklch(62.8% 0.258 29.2);
}
Tailwind CSS
<div class="bg-[#ff0000] text-black">...</div>

/* or register it once in your CSS (Tailwind v4) */
@theme {
  --color-red: #ff0000;
}
/* then use bg-red, text-red, border-red */
SwiftUI
import SwiftUI

extension Color {
  static let red = Color(red: 1.000, green: 0.000, blue: 0.000)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

val Red = Color(0xFFFF0000)
Flutter
import 'package:flutter/material.dart';

const red = Color(0xFFFF0000);
Android XML
<!-- res/values/colors.xml -->
<color name="red">#FF0000</color>

Frequently asked questions

What is the hex code for red?
The hex code for red is #FF0000. The same color is rgb(255, 0, 0), hsl(0, 100%, 50%) and oklch(62.8% 0.258 29.2), and in CSS you can also write the keyword red directly.
Is red a warm or cool color?
Red is a warm color: its hue is 0° on the HSL wheel, in the red, orange and yellow range (0° to about 70°, plus reds above 330°) that is conventionally called warm.
What colors go with red?
Rotating the hue in OKLCH while keeping lightness and chroma, red's complementary color is #009CB2 (close to cadetblue), its analogous colors are #F50084 and #D06800, and its triadic partners are #00A836 and #5577FF. For text on top, black gives the higher contrast.
Can you use white text on red?
White text on red has a contrast ratio of 3.99:1, which passes AA only for large text (24 px, or 18.66 px bold, and up) under WCAG 2.2. Black text reaches 5.25:1 and passes AA for normal text but not AAA. In APCA terms that is Lc −69.6 for white and Lc 40.0 for black.
What is the RGB value of red?
Red is rgb(255, 0, 0): red 255, green 0 and blue 0 on the 0 to 255 scale, or 100.0%, 0.0% and 0.0%. As a decimal integer it is 16711680.

Last reviewed by Arielton Oberek.