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.
Color Code Converter
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.
| Color | HEX code | RGB code | CSS name | |
|---|---|---|---|---|
| Red | rgb(255, 0, 0) | red | ||
| White | rgb(255, 255, 255) | white | ||
| Black | rgb(0, 0, 0) | black | ||
| Blue | rgb(0, 0, 255) | blue | ||
| Green | rgb(0, 128, 0) | green | ||
| Bright green | rgb(0, 255, 0) | lime | ||
| Yellow | rgb(255, 255, 0) | yellow | ||
| Orange | rgb(255, 165, 0) | orange | ||
| Purple | rgb(128, 0, 128) | purple | ||
| Pink | rgb(255, 192, 203) | pink | ||
| Gray | rgb(128, 128, 128) | gray | ||
| Maroon (burgundy) | rgb(128, 0, 0) | maroon | ||
| Navy blue | rgb(0, 0, 128) | navy | ||
| Brown | rgb(165, 42, 42) | brown | ||
| Gold | rgb(255, 215, 0) | gold | ||
| Silver | rgb(192, 192, 192) | silver | ||
| Turquoise | rgb(64, 224, 208) | turquoise | ||
| Cyan | rgb(0, 255, 255) | cyan / aqua | ||
| Magenta | rgb(255, 0, 255) | fuchsia / magenta | ||
| Olive | rgb(128, 128, 0) | olive | ||
| Beige | rgb(245, 245, 220) | beige | ||
| Lavender | rgb(230, 230, 250) | lavender | ||
| Salmon | rgb(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:
| Format | Example (same orange) | What it describes | Where it is used |
|---|---|---|---|
| HEX | #FF5733 | Red, green and blue values from 00 to FF (0–255), written side by side in base 16 | HTML, CSS, design apps, player name colors in games |
| RGB | rgb(255, 87, 51) | The same three values as decimal numbers from 0 to 255 | CSS, software, display settings |
| HSL | hsl(11, 100%, 60%) | Hue (0–360°), saturation and lightness (%) | Creating lighter or darker shades of one color in CSS |
| CMYK | 0%, 66%, 80%, 0% | Cyan, magenta, yellow and black ink percentages | Printing |
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:
#ff0000and#FF0000are the same. - Transparency: 8-digit HEX (
#RRGGBBAA) andrgb(255 0 0 / 50%)work in all current browsers. - Color names: CSS has more than 140 named colors such as
red,navyandgold; 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:
| Code | Name | HEX | |
|---|---|---|---|
| §0 | black | ||
| §1 | dark_blue | ||
| §2 | dark_green | ||
| §3 | dark_aqua | ||
| §4 | dark_red | ||
| §5 | dark_purple | ||
| §6 | gold | ||
| §7 | gray | ||
| §8 | dark_gray | ||
| §9 | blue | ||
| §a | green | ||
| §b | aqua | ||
| §c | red | ||
| §d | light_purple | ||
| §e | yellow | ||
| §f | white |
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.
| Color | Digit | Multiplier | Tolerance |
|---|---|---|---|
| Black | 0 | ×1 | – |
| Brown | 1 | ×10 | ±1% |
| Red | 2 | ×100 | ±2% |
| Orange | 3 | ×1 k | – |
| Yellow | 4 | ×10 k | – |
| Green | 5 | ×100 k | ±0.5% |
| Blue | 6 | ×1 M | ±0.25% |
| Violet | 7 | ×10 M | ±0.1% |
| Gray | 8 | ×100 M | – |
| White | 9 | ×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
-
CentOS 7 guides
-
cPanel 20 guides
-
CyberPanel 18 guides
-
Operating Systems 81 guides
-
Juniper Networks 18 guides
-
Control Panels 50 guides
-
Linux 17 guides
-
MySQL 29 guides
-
Network 95 guides
-
Plesk Panel 12 guides
-
Virtual Servers 273 guides
-
SEO 3 guides
-
Cyber Security 8 guides
-
Technology 162 guides
-
VMware 36 guides
-
WordPress 20 guides
-
Artificial Intelligence 22 guides