Polotno

Color converter

RGB to HEX converter

Enter RGB values, get the hex code plus copy-ready CSS rgb() and hsl() output, a live swatch, and a contrast check. Free, no signup, fully client-side.

Quick answer

Each channel becomes two hex digits: 29, 185, 84 is #1DB954.

Formula: R,G,B → #RRGGBB (each channel in base 16)

#1DB954
RGB

Contrast: 2.59:1 on white, 8.12:1 on black. Passes WCAG AA for body text on the better background.

Common colors

The math, in one line

Each RGB channel runs 0 to 255, which is exactly what two hex digits can hold (00 to FF). Convert each channel to base 16, pad to two digits, concatenate. 59, 130, 246 becomes 3B, 82, F6, so #3B82F6.

Common values

RGBHEXColor
255, 255, 255#FFFFFFWhite
0, 0, 0#000000Black
255, 0, 0#FF0000Red
0, 255, 0#00FF00Green
0, 0, 255#0000FFBlue
100, 116, 139#64748BSlate
24, 119, 242#1877F2Facebook blue

Which notation to ship

Hex is compact and dominant in design tools and brand guidelines, so it travels well between designers and developers. CSS rgb() is easier to compute with and needed for alpha. Pick one per codebase and stay consistent; the converter above outputs both so a handoff never blocks on notation.

Print work needs CMYK

Neither hex nor RGB survives contact with a press unchanged. Ink gamut is smaller than screen gamut, and accurate conversion needs an ICC profile rather than a formula. Use the RGB to CMYK converter before sending brand colors to a printer.

Frequently asked questions

Q: How do I convert RGB to HEX?

Write each channel as a two-digit base-16 number and join them. 29, 185, 84 becomes 1D, B9, 54, so the hex code is #1DB954. Enter any RGB triplet above to get the code plus copy-ready CSS.

Q: What is rgb(255, 255, 255) in hex?

#FFFFFF (white). rgb(0, 0, 0) is #000000 (black). Each channel maps to one hex pair, where 255 is FF and 0 is 00.

Q: Why does my RGB value produce a short hex code?

When all three pairs have matching digits, the code can be written in shorthand: #11BB99 is equivalent to #1B9. This converter always outputs the full six-digit form, which is safer in design handoffs.

Q: Can I convert RGBA with transparency?

Alpha is not part of a standard six-digit hex code. Modern CSS supports eight-digit hex (#RRGGBBAA), but the cleaner route is rgb(r g b / 50%), which the CSS output above uses as its base form.

Q: Will these colors print correctly?

No. RGB and hex describe screen light; presses use CMYK ink, and the conversion depends on paper and profile. Use the RGB to CMYK converter for print work.

Want this in your app? Embed Polotno SDK.

TRUSTED BY

100,000+

CREATORS

300+

BUSINESSES

ExpediaUnbounceLovePopPostGridPredis.ai