RGB & Color Code Converter

This tool has been used times.

Hex color codes are handy for computers but less intuitive for people.
This tool converts RGB and hex both ways, and lets you copy common colors with one click.

  • Look up a color code quickly
  • Copy a code from a color chart

RGB ↔ Hex Color Code Converter

Enter R / G / B from 0–255 to see the hex code and swatch. Or enter a 3- or 6-digit hex code to get RGB.

What is a hex color code?

Used in HTML/CSS to specify colors as # plus six hex digits (e.g. #FF0088). It simply lines up the RGB values converted to hexadecimal.

How conversion works (example: R 255 / G 0 / B 136)

1

Start with the RGB light values.

R 255 G 0 B 136
2

Convert each to a 2-digit hex value. Pad with a leading 0 when needed.

FF 00 88
3

Join R → G → B and add # at the front.

#FF0088

What do the numbers mean?

Screen colors mix R, G, and B light. Each channel has 256 levels (0–255), about 16.7 million colors in total.

3-digit shorthand

When both digits of a channel match, you can shorten to 3 digits, e.g. #F08 for FF0088 (#FFFFFF#FFF).

People often visualize RGB numbers more easily, while machines prefer codes — so converting both ways is useful. For RGB vs CMYK, see this article.

Color Chart by Name|White, Black, Red, Blue, Green (click to copy)

Common colors grouped by name with hex and RGB. Click or tap a swatch to copy its color code.

White / Gray

ffffff

rgb(255, 255, 255)

fafafa

rgb(250, 250, 250)

f5f5f5

rgb(245, 245, 245)

f0f0f0

rgb(240, 240, 240)

dddddd

rgb(221, 221, 221)

Black

000000

rgb(0, 0, 0)

888888

rgb(136, 136, 136)

222222

rgb(34, 34, 34)

aaaaaa

rgb(170, 170, 170)

444444

rgb(68, 68, 68)

cccccc

rgb(204, 204, 204)

666666

rgb(102, 102, 102)

eeeeee

rgb(238, 238, 238)

Red

ff0000

rgb(255, 0, 0)

ff4040

rgb(255, 64, 64)

ff8080

rgb(255, 128, 128)

ffbfbf

rgb(255, 191, 191)

Orange

ff8000

rgb(255, 128, 0)

ff9f40

rgb(255, 159, 64)

ffbf80

rgb(255, 191, 128)

ffdfbf

rgb(255, 223, 191)

Yellow

ffff00

rgb(255, 255, 0)

ffff40

rgb(255, 255, 64)

ffff80

rgb(255, 255, 128)

ffffbf

rgb(255, 255, 191)

Yellow-green

80ff00

rgb(128, 255, 0)

9fff40

rgb(159, 255, 64)

bfff80

rgb(191, 255, 128)

dfffbf

rgb(223, 255, 191)

Green

00ff00

rgb(0, 255, 0)

40ff40

rgb(64, 255, 64)

80ff80

rgb(128, 255, 128)

bfffbf

rgb(191, 255, 191)

Teal

00ff80

rgb(0, 255, 128)

40ff9f

rgb(64, 255, 159)

80ffbf

rgb(128, 255, 191)

bfffdf

rgb(191, 255, 223)

Sky blue

00ffff

rgb(0, 255, 255)

40ffff

rgb(64, 255, 255)

80ffff

rgb(128, 255, 255)

bfffff

rgb(191, 255, 255)

Cyan

0080ff

rgb(0, 128, 255)

409fff

rgb(64, 159, 255)

80bfff

rgb(128, 191, 255)

bfdfff

rgb(191, 223, 255)

Blue

0000ff

rgb(0, 0, 255)

4040ff

rgb(64, 64, 255)

8080ff

rgb(128, 128, 255)

bfbfff

rgb(191, 191, 255)

Purple

8000ff

rgb(128, 0, 255)

9f40ff

rgb(159, 64, 255)

bf80ff

rgb(191, 128, 255)

dfbfff

rgb(223, 191, 255)

Pink

ff00ff

rgb(255, 0, 255)

ff40ff

rgb(255, 64, 255)

ff80ff

rgb(255, 128, 255)

ffbfff

rgb(255, 191, 255)

Hot pink

ff0080

rgb(255, 0, 128)

ff409f

rgb(255, 64, 159)

ff80bf

rgb(255, 128, 191)

ffbfdf

rgb(255, 191, 223)

Frequently Asked Questions

What is the RGB / hex for white?
White is rgb(255, 255, 255) / #FFFFFF (or #FFF). Soft grays like #FAFAFA and #F5F5F5 are common backgrounds. Copy them from the White / Gray chart above.
What are the RGB values for red, green, and blue?
Primary light colors: red rgb(255, 0, 0) (#FF0000), green rgb(0, 255, 0) (#00FF00), blue rgb(0, 0, 255) (#0000FF). Set one channel to 255 and the others to 0 for a pure hue.
How do I convert hex to RGB?
Drop #, split into three 2-digit pairs, and convert each to decimal. #FF0088 → FF=255, 00=0, 88=136 → rgb(255, 0, 136). Or paste the code into the converter above.
What is different about 3-digit codes like #F08?
A 3-digit code doubles each digit: #F08 = #FF0088, #FFF = #FFFFFF. This tool accepts 3-digit input too.
Should I use rgb() or hex?
They describe the same color. Hex is common in CSS; rgb()/rgba() is handy in JS or when you need opacity. Follow your project’s convention.
What are the codes for white, black, red, etc.?
White #FFFFFF, black #000000. Primaries: red #FF0000, green #00FF00, blue #0000FF. Copy them from the chart above.

Please also review the Terms of Use for this web app before using it.

Found a bug or have feedback? Let us know here.

Report bugs, display issues, usability problems, or suggestions for improvement.
Consent
・This form is for bug reports only. In principle, we do not respond to individual submissions.
・If a submission contains defamatory, threatening, or otherwise inappropriate content, we may take appropriate action based on logs such as IP addresses.

目次