Green hex code

The hex code for green is #008000, or rgb(0, 128, 0). CSS also accepts the keyword green.

#008000
HEX#008000
RGBrgb(0, 128, 0)
HSLhsl(120, 100%, 25%)
HSV / HSBhsv(120, 100%, 50%)
OKLCHoklch(51.98% 0.1769 142.5)
CMYKcmyk(100%, 0%, 100%, 50%)
HEX, 50% opacity#00800080
RGB, 50% opacityrgb(0 128 0 / 50%)
CSS namegreen
Defined inHTML 4.01 (one of the original 16 color names)

About green

CSS green (#008000) is a medium-dark green, with the green channel at about half strength. Full-strength green is named lime (#00FF00). Both names are among the 16 HTML 4 colors, where green was defined as the darker of the two.

Other CSS greens range from forestgreen (#228B22) and seagreen (#2E8B57) to the bright limegreen (#32CD32).

Shades and tints of green

Green lands on the 700 step. The steps follow a lightness curve modeled on Tailwind CSS's default palette; build your own in the Tailwind color generator. For green mixed with white, black or gray in even steps, use the tint and shade generator.

50#F2FAF1100#E3F5E1200#C5EBC1300#9BDC95400#67C760500#3FB639600#009900700#008000800#0D670B900#195516950#0E310C

Colors that go with green

Partner hues are picked on the OKLCH color wheel.

Complementary: the opposite hue

#008000#963BA3

Open in the palette generator · Compare the screen and painter's complements of green

Analogous: neighboring hues 30° either side

#008000#6B6F00#007E61

Open in the palette generator · See analogous and monochromatic colors of green on three wheels

Triadic: three hues 120° apart

#008000#2C61CD#B92C36

Open in the palette generator

Split complementary: the two hues beside the complement

#008000#6F4DC3#AF2D72

Open in the palette generator

Text on green

White text on green: 5.14:1
Black text on green: 4.09:1
TextRatioAA normalAA largeAAA normal
White5.14:1PassPassFail
Black4.09:1FailPassFail

The ratio is the same either way round, so green text on a white background is also 5.14:1. Check other pairs in the color contrast checker.

Similar named colors

The CSS named colors closest to green, by deltaE OK distance.

forestgreen #228B22seagreen #2E8B57darkgreen #006400darkolivegreen #556B2Folivedrab #6B8E23olive #808000

See all 148 on the color names page.

Closest Tailwind CSS colors

green-700 v4: green-700, #008236, deltaE OK 0.032

green-700 v3: green-700, #15803D, deltaE OK 0.045

In Tailwind CSS v4 it is green-700 (#008236), and in v3 green-700 (#15803D). For the exact color, use an arbitrary value such as bg-[#008000]. A deltaE OK of around 0.02 is roughly the smallest difference most people notice side by side. Browse every shade on the Tailwind CSS colors page.

Green with color vision deficiency

An approximation of how green may look with protanopia, deuteranopia and tritanopia (simulated with Machado, Oliveira and Fernandes, 2009), and with achromatopsia, shown as a gray of the same luminance.

protanopia #837200deuteranopia #776A18tritanopia #007C6Cachromatopsia #6D6D6D

Test a whole palette or image in the color blindness simulator.

Using green in code

.example {
  color: green;                 /* named color */
  background-color: #008000;  /* hex */
  border-color: rgb(0, 128, 0);
}

Frequently asked questions

What is the hex code for green?
#008000. CSS also accepts the keyword green, which means the same color.
What is green in RGB?
rgb(0, 128, 0). In HSL it is hsl(120, 100%, 25%), and in OKLCH oklch(51.98% 0.1769 142.5).
What text color goes on green?
White text has the higher contrast on #008000: 5.14:1, which meets AA for all text. Black text reaches 4.09:1.
What is the closest Tailwind color to green?
In Tailwind CSS v4 it is green-700 (#008236), and in v3 green-700 (#15803D). For the exact color, use an arbitrary value such as bg-[#008000].
How do I make green transparent?
Add an alpha value. Half-transparent green is #00800080 as 8-digit HEX (80 is 128 out of 255) or rgb(0 128 0 / 50%).