Home › Image Tools › HTML Color Codes

HTML Color Codes

Every named color supported by HTML and CSS, with its HEX, RGB and HSL code. Search by name or code, filter by color family, sort by hue or lightness, and click any color to copy its code. The 216-color web-safe palette is one tab away.

Last updated:

Aa
coral

Advertisement
Advertisement

How to use the HTML Color Codes

  1. Browse or search: scroll the grid, or type a name ("blue", "sea") or a HEX code ("#ff7f50") in the search box.
  2. Filter by color family with the chips, and choose how to sort the grid: by family, name, hue, lightness or HEX.
  3. Pick a copy format: name, HEX, RGB or HSL.
  4. Click a color to copy its code. The detail panel shows every format with its own copy button and the contrast against white and black text.
  5. Need web-safe colors? Open the Web-safe palette tab and click any of the 216 cells to copy its HEX code.

How HTML color codes work

A HEX color code such as #FF7F50 is three pairs of hexadecimal digits for the red, green and blue channels. Each pair runs from 00 (0, none of that light) to FF (255, full intensity), so #FF7F50 means red 255, green 127, blue 80, which is rgb(255, 127, 80) and the named color coral. A three-digit shorthand doubles each digit: #369 is #336699.

HSL describes the same color as hue (0 to 360 degrees around the color wheel: 0 red, 120 green, 240 blue), saturation (0% gray to 100% vivid) and lightness (0% black, 50% pure color, 100% white). It is the easiest format for making a color a little lighter or darker by hand.

FormatExample (coral)CSS usage
Color namecoralcolor: coral;
HEX#FF7F50color: #ff7f50;
HEX with alpha#FF7F5080color: #ff7f5080; (50% opacity)
RGBrgb(255, 127, 80)color: rgb(255 127 80 / 50%);
HSLhsl(16, 100%, 66%)color: hsl(16 100% 66%);

The 16 basic HTML colors

These 16 names date back to HTML 3.2 (1997) and are the ones you will see most often in older code and tutorials. The other names were added from the X11 window system color list.

NameHEXRGBNameHEXRGB
black#0000000, 0, 0silver#C0C0C0192, 192, 192
gray#808080128, 128, 128white#FFFFFF255, 255, 255
maroon#800000128, 0, 0red#FF0000255, 0, 0
purple#800080128, 0, 128fuchsia#FF00FF255, 0, 255
green#0080000, 128, 0lime#00FF000, 255, 0
olive#808000128, 128, 0yellow#FFFF00255, 255, 0
navy#0000800, 0, 128blue#0000FF0, 0, 255
teal#0080800, 128, 128aqua#00FFFF0, 255, 255

Note that the CSS green is a medium green (#008000); the pure, full-intensity green channel is called lime.

Choosing readable text colors

The detail panel shows the WCAG 2 contrast ratio of the selected color against white and black text. The ratio is (L1 + 0.05) / (L2 + 0.05), where L1 and L2 are the relative luminances of the lighter and darker color. Body text needs at least 4.5:1 for level AA and 7:1 for AAA; large text (about 24 px, or 19 px bold) needs 3:1. For example, white text on steelblue reaches only about 4.1:1, while white on navy is well above 7:1. To check any two colors, use the Color Contrast Checker.

Frequently asked questions

How many HTML color names are there?

There are 140 classic HTML color names that every browser supports, such as red, navy, coral and lightgoldenrodyellow. CSS Color Level 4 adds rebeccapurple (#663399), and it also accepts the British spelling grey in seven names (grey, darkgrey, lightgrey, dimgrey, slategrey, darkslategrey, lightslategrey), for 148 keywords in total. This page lists the 141 distinct names.

Are HTML color names case-sensitive?

No. CSS color keywords are case-insensitive, so Red, RED and red all mean #FF0000. Most style guides write them in lowercase, which is how the code is copied from this page.

Do some color names share the same code?

Yes. aqua and cyan are both #00FFFF, and fuchsia and magenta are both #FF00FF. The gray and grey spellings are also identical.

What are web-safe colors?

The web-safe palette is 216 colors made from every combination of the values 00, 33, 66, 99, CC and FF for red, green and blue. It was designed for 1990s screens that could only show 256 colors. Modern displays show millions of colors, so you no longer have to stick to it, but its short codes like #369 are still handy.

Should I use color names or HEX codes in CSS?

Both work in every browser. Names are easier to read in quick prototypes, while HEX, RGB or HSL give you the exact shade you need from a design and are used by most design tools. The rendered color is identical for a name and its HEX value.

Why is "darkgray" lighter than "gray"?

It is a historical quirk. The CSS names came from the X11 color list, where darkgray is #A9A9A9, while gray was taken from the older HTML 3.2 set at #808080. So darkgray ends up lighter than gray.

How do I write a color code in HTML?

Use CSS, for example style="color: tomato" or style="background-color: #FF6347" or color: rgb(255, 99, 71). All three give the same tomato red.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Color PickerPick any color and get HEX, RGB, HSL, HSV and CMYK codes, shades and a screen eyedropper.Color Name FinderFind the closest color name for any HEX or RGB color.HEX to RGBConvert HEX colors to RGB and other formats.Color Palette GeneratorGenerate beautiful color palettes and export them.ANSI Color Code GeneratorStyle terminal text with 16, 256 or RGB colors and get escape codes for bash, Python, JS and C.CSS Background Pattern GeneratorMake pure-CSS stripes, dots, checkerboard, zigzag and grid backgrounds and copy the code.CSS Hover Effects GeneratorPick button, link and image hover effects, tweak colors and timing, and copy the HTML and CSS.CSS ValidatorValidate CSS: syntax errors, unknown properties and invalid values by line, plus auto-fix.RGB to HEXConvert RGB to HEX with sliders, live swatch and one-click copy.HEX to HSLConvert HEX colors to HSL and back with interactive sliders.RGB to CMYK ConverterConvert RGB and HEX colors to CMYK for print, and back.Color Contrast CheckerCheck WCAG contrast ratios and find accessible text colors.Pantone to HEXLook up approximate HEX, RGB and CMYK values for Pantone colors.Color Blindness SimulatorSee any image as people with protanopia, deuteranopia, tritanopia or achromatopsia see itImage Color PickerPick any pixel colour from an image and get HEX, RGB, HSL plus a paletteColor Shades GeneratorTurn one HEX color into a 50-950 scale plus tints, shades and tones, ready to export.Tailwind Color GeneratorTurn one color into a full Tailwind 50–950 shade scale and export the config or CSS.Color MixerMix two colors in sRGB, linear, OKLab or OKLCH, or blend them with Photoshop-style modes.Random Color GeneratorGenerate random HEX colors one at a time or in batches, with hue, saturation and lightness ranges.Color WheelFind complementary, triadic, analogous and other color harmonies on an interactive wheel.Color Palette from ImageExtract the main colors of any photo as HEX codes, CSS variables and a palette PNG.Replace Color in ImageClick a color in a picture and swap it for a new color or transparency, keeping the shading.CMYK to RGBConvert CMYK percentages to RGB and HEX color codes with sliders and a live preview.HSL to HEXConvert HSL and HSLA colors to HEX and RGB with sliders and a live preview.HEX to RGBAConvert HEX color codes to CSS rgba() with an opacity slider and one-click copy.RGBA to HEXConvert rgba() colors to 8-digit HEX, or flatten transparency onto any background.HEX to CMYKConvert HEX color codes to CMYK percentages for print, with a live preview.HEX to PantoneFind the 5 closest Pantone-style solid coated colors for any HEX or RGB, ranked by Delta E.Color Temperature to RGBConvert a color temperature in kelvin (1000-40000 K) to RGB and HEX with a live swatch.OKLCH Color ConverterConvert HEX, RGB and HSL to OKLCH, OKLab, Lab and LCH with sRGB and P3 gamut checks.RGB to HSLConvert RGB values to HSL, HSV and HWB with a live swatch and copy-ready CSS.Color Code ConverterConvert a color between HEX, RGB, HSL, HSV, CMYK, LAB, LCH and OKLCH with a live swatch.Room Paint Color VisualizerUpload a room photo, select the walls and preview any paint color or HEX with real lighting.Photo to Pop ArtMake Warhol-style pop art from a photo: posterized color tiles in 1, 4 or 9 grids with custom palettes.Screen Color PickerPick any pixel color from anywhere on your screen and copy it as HEX, RGB or HSL.Solid Color Image GeneratorMake a plain single-color or transparent image in any size, like 1920x1080, as PNG or JPG.White Balance CorrectorFix color casts: click a neutral gray point or use auto gray world, then fine-tune temperature and tint.CMYK to HEXConvert CMYK percentages to a HEX color code and RGB, with a live swatch and shades.Photo Color MatchCopy the color grading of a reference photo onto your image (Reinhard color transfer).Underwater Photo Color CorrectionRestore lost reds and remove the blue or green cast from underwater photos by depth.
See all 38 Color Tools →