HomeDevHTML Color Codes
Color tools

HTML Color Codes

Use this free CalculatorX tool for fast local results with clear formulas, worked examples, and privacy-first browser calculation. Fast and free.

Loading tool…

Loading Preparing tool…

How to use

Follow these steps for a clear answer.

1

Browse or search

Filter by color family or type a name or HEX to find CSS named colors.

2

Select a swatch

Click a color to see its name, HEX, RGB, and HSL in the detail panel.

3

Copy into HTML or CSS

Copy the keyword, HEX, or rgb() string for styles and markup.

Color formulas

Core relationships used by this color tool.

Named colorcolor: tomato;
HEX#RRGGBB (00–FF per channel)
RGBrgb(R, G, B) R,G,B ∈ [0, 255]
HSLhsl(H°, S%, L%)
iKeyword names map to fixed sRGB values. Hex and rgb() describe the same channels; hsl() is often easier for adjusting lightness.

Example colors

Common picks with formula and result.

ϟ

Classic red

Named keyword

color: red;
#FF0000 · rgb(255, 0, 0)
ϟ

Tomato accent

Extended name

background-color: tomato;
#FF6347 · rgb(255, 99, 71)
ϟ

Navy text

Dark blue keyword

color: navy;
#000080 · rgb(0, 0, 128)
ϟ

White on blue

Inline style pair

style="background:#0000FF;color:#FFF"
High-contrast banner

HTML color codes specification

Version 1.0.0

Definition
HTML color codes identify colors for the web as CSS keywords, hexadecimal (#RRGGBB), RGB, or HSL values. HTML and CSS share the same color system—about 148 named colors plus 16,777,216 possible 24-bit hex colors.
What it calculates
Lookup of CSS named colors with HEX, RGB, and HSL, plus copyable snippets for HTML/CSS.
Inputs
  • Optional search string (name or HEX)
  • Optional color-family filter
  • Selected swatch from the chart
Outputs
  • CSS keyword name
  • HEX (#RRGGBB)
  • rgb() and hsl() strings
  • Example color / background-color declarations
Formula
Named color → fixed sRGB; HEX ↔ RGB channel pairs; HSL derived from RGB

Hex codes use six hexadecimal digits: each pair is one channel from 00 (off) to FF (full). White is #FFFFFF, black is #000000, and equal channels make grays (for example #808080).

For a single custom hue outside the named list, use the HTML color picker. For related accents, try the color wheel.

<p style="color: tomato;">Named color</p>
<p style="color: #FF6347;">Hex color</p>
<p style="color: rgb(255, 99, 71);">RGB color</p>
.banner {
  background-color: navy;
  color: #ffffff;
}
a {
  color: dodgerblue;
}
16 basic HTML / CSS colors
NameHEXRGB
black#0000000, 0, 0
silver#C0C0C0192, 192, 192
gray#808080128, 128, 128
white#FFFFFF255, 255, 255
maroon#800000128, 0, 0
red#FF0000255, 0, 0
purple#800080128, 0, 128
fuchsia#FF00FF255, 0, 255
green#0080000, 128, 0
lime#00FF000, 255, 0
olive#808000128, 128, 0
yellow#FFFF00255, 255, 0
navy#0000800, 0, 128
blue#0000FF0, 0, 255
teal#0080800, 128, 128
aqua#00FFFF0, 255, 255
i aqua = cyan and fuchsia = magenta. grey/gray spellings are aliases for the same hex.
Assumptions
  • Values follow CSS Color Module named-color mappings (sRGB).
  • Chart runs locally; nothing is uploaded.
  • Duplicate aliases (grey/gray, aqua/cyan, fuchsia/magenta) share the same hex.
Units
  • HEX: #RRGGBB
  • RGB: 0–255
  • HSL: hue degrees; S and L percent
Boundary conditions
  • Unknown search text yields an empty filtered list.
  • Only the 148 CSS keywords are charted; arbitrary hex still works via the color picker.
Example
tomato → #FF6347 → rgb(255, 99, 71)
Validation cases
  • red → #FF0000
  • aqua / cyan → #00FFFF
  • rebeccapurple → #663399
  • gray / grey → #808080
Sources
  • CSS Color Module named colors
  • sRGB / HTML & CSS color notation
Calculation version
1.0.0

Frequently asked questions

Key distinctions behind the tool.

What are HTML color codes?

Identifiers for colors on the web: CSS color names, hex codes, rgb()/rgba(), and hsl()/hsla(). They work in HTML style attributes and in CSS.

How many named HTML colors are there?

CSS defines 148 named color keywords (including grey/gray aliases and rebeccapurple). The chart above lists all of them with HEX and RGB.

What is the difference between HEX and RGB?

They encode the same channels. HEX uses two hex digits per channel (#RRGGBB); RGB uses decimals 0–255. Example: #FF0000 = rgb(255, 0, 0).

How do I set a color in HTML?

Use an inline style such as style="color: tomato" or style="background-color: #FF6347", or define rules in a stylesheet.

Are web safe colors still required?

No. Modern displays support full 24-bit color. The 216-color web-safe palette is historical; prefer named colors or any hex you need.