HEX and RGB Colour Converter
Converts in both directions between hex and RGB. Useful because design tools and code tend to disagree about which format they want — a colour picker gives you RGB sliders while a stylesheet wants a hex string.
Free, no signupRuns entirely in your browser
Input
Result
rgb(59, 130, 246)
About
What the HEX and RGB Colour Converter does
The two notations describe exactly the same colours; neither can express anything the other cannot. Hex is more compact and is the convention in CSS, while RGB is easier to compute with.
How it works
Using the HEX and RGB Colour Converter
- 1Enter a colour in either hex or RGB.
- 2For hex to RGB, each two-digit pair converts to a 0-255 value.
- 3For RGB to hex, each value converts to two hex digits, padded with a leading zero if needed.
- 4The converted value appears immediately.
- 5Copy it in whichever format you need.
Use cases
What people use it for
- Moving a palette from a design tool into CSS
- Documenting brand colours in both notations
- Converting a colour picked from a screenshot
- Normalising mixed colour formats in a stylesheet
FAQ
Frequently asked questions
6 related
All tools →