Nothing uploaded
Convert RGB to HEX
Type an RGB color, such as rgb(46, 139, 87) or simply 46, 139, 87, to get its hex code and every other format, ready to copy.
HEX, rgb(), hsl(), hsv(), cmyk(), oklch() or a CSS name such as tomato.
Contrast
On white 4.25:1
- AA, normal text: Fail
- AA, large text: Pass
- AAA, normal text: Fail
- AAA, large text: Fail
On black 4.95:1
- AA, normal text: Pass
- AA, large text: Pass
- AAA, normal text: Fail
- AAA, large text: Pass
For text in this color on a white or black background (WCAG 2). Large text is 24 px, or 18.66 px bold.
Formats
Read as RGB.
- HEX
- #2e8b57
- RGB
- rgb(46, 139, 87)
- HSL
- hsl(146.5, 50.3%, 36.3%)
- HSV (HSB)
- hsv(146.5, 66.9%, 54.5%)
- CMYK (approximate)
- cmyk(66.9%, 0%, 37.4%, 45.5%)
- OKLCH
- oklch(56.85% 0.1187 154.95)
- CSS name
- seagreen
CMYK uses the simple formula, without a color profile. Printers convert with their own profile, so treat it as a starting point.
What you type stays on this device. Nothing is uploaded.
Did this save you time? DigiTools is free, with no ads and no sign-up. Leave a tip (opens in a new tab) to help keep it that way.
Tell others what you think: review DigiTools on Trustpilot (opens in a new tab).
How to convert RGB to HEX
- Type or paste an RGB color, such as rgb(46, 139, 87).
- Read the HEX value at the top, with every other format under it. It updates as you type.
- Copy what you need, and check how readable the color is on white and on black.
Questions
Is anything sent to a server?
No. Colors are converted in your browser on this device, as you type, and nothing is stored.
How do I convert RGB to HEX by hand?
Write each number from 0 to 255 as two hexadecimal digits: divide by 16 for the first digit and keep the remainder for the second, writing 10 to 15 as a to f. 46 is 2 × 16 + 14, so 2e; 139 is 8b and 87 is 57, which makes #2e8b57.
Can I paste values with transparency or percentages?
Yes: rgba(46, 139, 87, 0.5), the newer rgb(46 139 87 / 50%) and percentages such as rgb(18% 55% 34%) all work. Transparency becomes the last two digits of an 8-digit hex code.