Color Codes: HEX and RGB Color Code Chart with a Color Converter

Sunucun 6 min read

Color codes describe a color as numbers a computer can understand. Websites mostly use HEX (e.g. #FF0000) and RGB (e.g. rgb(255, 0, 0)). Use the tool below to pick any color and copy its HEX, RGB, HSL and CMYK values, or grab the codes of the most searched colors from the chart underneath.

Illustration: Color Codes: HEX

Color Code Converter

HEX
RGB
HSL
CMYK
 
 

Basic Color Codes Chart (Click to Copy)

Click a HEX code in the chart to copy it to the clipboard and load it into the converter above. The values come from the standard CSS color names that every browser understands. Colors such as maroon, navy or gold have no single official shade; the chart lists the most widely used CSS values.

ColorHEX codeRGB codeCSS name
Redrgb(255, 0, 0)red
Whitergb(255, 255, 255)white
Blackrgb(0, 0, 0)black
Bluergb(0, 0, 255)blue
Greenrgb(0, 128, 0)green
Bright greenrgb(0, 255, 0)lime
Yellowrgb(255, 255, 0)yellow
Orangergb(255, 165, 0)orange
Purplergb(128, 0, 128)purple
Pinkrgb(255, 192, 203)pink
Grayrgb(128, 128, 128)gray
Maroon (burgundy)rgb(128, 0, 0)maroon
Navy bluergb(0, 0, 128)navy
Brownrgb(165, 42, 42)brown
Goldrgb(255, 215, 0)gold
Silverrgb(192, 192, 192)silver
Turquoisergb(64, 224, 208)turquoise
Cyanrgb(0, 255, 255)cyan / aqua
Magentargb(255, 0, 255)fuchsia / magenta
Olivergb(128, 128, 0)olive
Beigergb(245, 245, 220)beige
Lavenderrgb(230, 230, 250)lavender
Salmonrgb(250, 128, 114)salmon

What Is a Color Code? HEX vs RGB vs HSL vs CMYK

Screens build every pixel by mixing red, green and blue light. Color codes write that mix down in different ways:

FormatExample (same orange)What it describesWhere it is used
HEX#FF5733Red, green and blue values from 00 to FF (0–255), written side by side in base 16HTML, CSS, design apps, player name colors in games
RGBrgb(255, 87, 51)The same three values as decimal numbers from 0 to 255CSS, software, display settings
HSLhsl(11, 100%, 60%)Hue (0–360°), saturation and lightness (%)Creating lighter or darker shades of one color in CSS
CMYK0%, 66%, 80%, 0%Cyan, magenta, yellow and black ink percentagesPrinting

The CMYK value from the converter is a simple mathematical conversion. The actual printed color depends on the paper, the ink and the printer’s color profile, so check print colors with your print shop. Pantone and RAL are numbered color catalogs; their HEX equivalents are only approximate.

How to convert HEX to RGB by hand

A HEX code is three pairs of characters: #FF5733 → FF (red), 57 (green), 33 (blue). Each pair is in base 16: FF = 15×16 + 15 = 255, 57 = 5×16 + 7 = 87, 33 = 3×16 + 3 = 51. Result: rgb(255, 87, 51). In the three-digit short form each digit is doubled: #F00 = #FF0000.

How to Use HTML and CSS Color Codes

In CSS, text color is set with color, background color with background-color and border color with border-color. All of the following produce the same red:

p        { color: #FF0000; }
.box     { background-color: rgb(255, 0, 0); }
.warning { border: 2px solid hsl(0, 100%, 50%); }
.title   { color: red; }  /* CSS color name */
.half    { background-color: #FF000080; } /* last two digits = transparency */
  • Case does not matter: #ff0000 and #FF0000 are the same.
  • Transparency: 8-digit HEX (#RRGGBBAA) and rgb(255 0 0 / 50%) work in all current browsers.
  • Color names: CSS has more than 140 named colors such as red, navy and gold; the “CSS name” column in the chart shows them.
  • In WordPress: when choosing a text or background color in the block editor, paste a HEX code into the custom color field. To change theme colors permanently, see our WordPress theme and plugin development guide.

Readability: the color contrast rule

The web accessibility standard WCAG 2 asks for a contrast ratio of at least 4.5:1 between normal text and its background, and at least 3:1 for large text (level AA). The converter calculates the contrast of the selected color with white and black text, so when you choose a button or background color you can see whether the text on it should be white or black.

Finding the Code of a Color on Your Screen

  • A color on a website: in Chrome or Edge, right-click the element and choose Inspect; click the color square in the Styles panel and use the eyedropper in the picker to read the code of any point on the page.
  • Windows: the Color Picker in Microsoft PowerToys picks colors from anywhere on the screen; its default shortcut is Win + Shift + C.
  • Mac: the built-in Digital Color Meter app shows the values of the color under the pointer.
  • Paste the code you found into the converter above to see its HEX, RGB and HSL equivalents.

Minecraft Color Codes

In Minecraft, colors on signs, in books, server MOTDs and plugin messages are set with the § sign followed by one character (many server plugins also accept the same codes with &). Java Edition color codes and their HEX values:

CodeNameHEX
§0black
§1dark_blue
§2dark_green
§3dark_aqua
§4dark_red
§5dark_purple
§6gold
§7gray
§8dark_gray
§9blue
§agreen
§baqua
§cred
§dlight_purple
§eyellow
§fwhite

Formatting codes: §l bold, §o italic, §k obfuscated text, §r reset. §m (strikethrough) and §n (underline) work in Java Edition; in Bedrock Edition those letters are used for extra colors, and some shared codes have a different shade. Source: Minecraft Wiki, “Formatting codes”.

Color codes in other games (MTA, Car Parking)

Many games use HEX codes to color chat messages or player names; only the syntax differs from game to game. In MTA:SA, for example, colored chat messages use #RRGGBB tags (e.g. #FF0000Hello). For games such as Car Parking Multiplayer, check the game’s own help page for the syntax; you can copy the HEX code of the color you want from the chart or the converter on this page.

Resistor Color Codes

In electronics, “color codes” are a different system: the colored bands on a resistor show its value (IEC 60062). On a 4-band resistor the first two bands are digits, the third is the multiplier and the fourth is the tolerance.

ColorDigitMultiplierTolerance
Black0×1–
Brown1×10±1%
Red2×100±2%
Orange3×1 k–
Yellow4×10 k–
Green5×100 k±0.5%
Blue6×1 M±0.25%
Violet7×10 M±0.1%
Gray8×100 M–
White9×1 G–
Gold–×0.1±5%
Silver–×0.01±10%

Example: yellow–violet–red–gold = 4, 7, ×100 → 4,700 Ω (4.7 kΩ), ±5%.

Frequently Asked Questions

What is the color code for red?

Pure red is #FF0000 in HEX and rgb(255, 0, 0) in RGB. For a darker red use #8B0000 (darkred); for maroon use #800000.

What are the color codes for white and black?

White is #FFFFFF (rgb(255, 255, 255)) and black is #000000 (rgb(0, 0, 0)). Their short forms are #FFF and #000.

What is the gold color code?

The CSS color gold is #FFD700. For a more muted, metallic gold, designers often use values such as #D4AF37; there is no single official “gold” code.

Is the # sign required in a HEX code?

In HTML and CSS, yes: a code without # is not recognized. Some apps and games, however, expect the code without #. The converter accepts both.

If you want to build your own website and style it freely, take a look at our web hosting plans. For color and block settings in WordPress, our Gutenberg editor guide may also help.

Categories

Latest guides