RGB to HEX converter
Enter the red, green and blue values and get a HEX code ready for CSS, design apps and brand guides.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter red (r), green (g) and blue (b).
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
Each channel is rounded to a whole number and written as two base-16 digits: #RRGGBB.
Example
Inputs: Red (R) = 30, Green (G) = 144, Blue (B) = 255. Result: HEX code: #1E90FF.
Limits and caveats
- The fields take whole numbers 0 to 255 only; convert percentages such as rgb(50%, 0%, 0%) first.
- All values are treated as sRGB, the default web color space, not Display P3 or Adobe RGB.
Questions about this tool
How do I convert RGB to HEX by hand?
Write each channel as two base-16 digits: 30 = 1E, 144 = 90 and 255 = FF, which gives #1E90FF.
What range do the RGB fields accept?
Each channel takes a whole number from 0 to 255, where 0 means none of that light and 255 means full intensity.
Is the HEX code upper or lower case?
It is shown in upper case, like #1E90FF. Browsers treat both cases as the same color.
