Color Conversion Tools

RGB to Color Name

Name an RGB color with the closest CSS keyword. Enter three channel values and learn whether they match a named color exactly, or which of the 148 names comes nearest.

RGB to Color Name

Edit a channel and see the color result immediately.

Swap direction

Enter RGB

RGB channels are whole numbers from 0 to 255.

CSS color name result

Source color
Result color
steelblue

Closest of 148 CSS named colors; the name is an approximation.

The conversion runs in your browser.

All formats

HEX
#336699
RGB
rgb(51, 102, 153)
HSL
hsl(210, 50%, 40%)
HSV
hsv(210°, 66.7%, 60%)
CMYK
cmyk(66.7%, 33.3%, 0%, 40%)
OKLCH
oklch(49.9% 0.099 250.4)
CSS
≈ steelblue

Tints and shades

Text contrast (WCAG)

Aa6.00:1On whiteAA
Aa3.50:1On blackLarge text only

Normal text needs 4.5:1 for AA and 7:1 for AAA; large text needs 3:1.

How it was calculated

  1. ΔE(Oklab) → steelblue = #4682b4

Common colors in RGB and CSS color name

Choose a color to load it into the converter.

ColorRGBCSS color name
rgb(0, 0, 0)black
rgb(255, 255, 255)white
rgb(255, 0, 0)red
rgb(0, 255, 0)lime
rgb(0, 0, 255)blue
rgb(255, 255, 0)yellow
rgb(0, 255, 255)aqua
rgb(255, 0, 255)fuchsia
rgb(128, 128, 128)gray
rgb(128, 0, 0)maroon
rgb(0, 128, 0)green
rgb(0, 0, 128)navy
rgb(255, 165, 0)orange
rgb(70, 130, 180)steelblue
rgb(102, 51, 153)rebeccapurple
rgb(255, 99, 71)tomato

How to use

  1. Enter the red, green and blue channels from 0 to 255.
  2. Read the keyword and compare the swatches; the note says whether it is an exact or closest match.
  3. Copy the name, or keep the RGB values if the nearest keyword looks different.

Examples

An exact match

These are exactly the channels CSS defines for cornflowerblue, so the name and the numbers are interchangeable.

Input
rgb(100, 149, 237)
Output
cornflowerblue

Close, but not identical

No keyword has these channels, but cornflowerblue is the smallest perceptual distance away, so it is returned as the closest name.

Input
rgb(101, 150, 230)
Output
cornflowerblue

Why put a name on RGB values

Numbers are precise but anonymous. A name makes colors easier to discuss, log and search for:

  • Image and data analysis. After clustering a photo’s pixels, naming each cluster (“steelblue”, “khaki”) makes results readable.
  • Debugging rendering. When a test reports rgb(101, 150, 230), knowing it is cornflowerblue-ish helps you find which style produced it.
  • Accessible descriptions. A word is often more helpful than numbers in alt text or chart legends.

How the closest name is found

The 148 CSS keywords form a small, uneven palette. First the converter checks for an exact channel match, which is reported as such. Otherwise it converts your color and every keyword into Oklab, a perceptual space, and picks the keyword with the smallest straight-line distance. The calculation panel shows the chosen keyword and its HEX value.

A perceptual space matters: in raw RGB, a small change in green is far more visible than the same change in blue. Oklab corrects for that, so the chosen name is the one that looks closest.

Limits of a 148-color vocabulary

Many colors sit far from any keyword, especially muted mid-tones and dark saturated colors. The result swatch shows the keyword’s real color next to yours; if they differ visibly, describe the color with its hue family (from the HSV or HSL value in the All formats panel) instead.

To get numbers back from a name, use Color Name to RGB. Starting from a code instead? Try HEX to Color Name.

Frequently asked questions

When is a color name useful for RGB values?

For labelling pixels or clusters in image analysis, naming chart series, writing human-readable logs, and describing a sampled color in a support ticket or design review.

How does the converter decide what is closest?

It compares colors in the Oklab space, where equal distances look roughly equally different to people. That gives better names than comparing raw red, green and blue differences.

Why did a dark color get a surprising name?

CSS has few dark keywords, so a dark teal might be closest to darkslategray. The result swatch shows the keyword's actual color so you can judge.

Can I get names in other languages?

The result is a CSS keyword, which is always English. Those keywords work in any stylesheet regardless of page language.

Is the matching done on a server?

No. The palette and the comparison are bundled with the page.

Related tools