HEX to RGB Converter
Enter a HEX color code like #3b82f6 and get the RGB values instantly. All conversion happens in your browser.
CONVERT
All three formats are shown simultaneously regardless of mode.
How it works
A HEX code is three bytes written in base 16. The converter splits #3b82f6 into 3b, 82 and f6 and reads each pair as a number: 3 × 16 + 11 = 59, 8 × 16 + 2 = 130 and 15 × 16 + 6 = 246, giving rgb(59, 130, 246). A 3-digit code is expanded first by doubling each digit, so #f80 becomes #ff8800, rgb(255, 136, 0). All conversion runs in JavaScript in your browser.
Processing runs in your browser
All computation happens inside your browser tab. Our servers are not involved at any point.
Related operations
To check whether two colours meet WCAG legibility, try the contrast checker. For building a coordinated set from one base colour, use the colour palette generator. To craft smooth multi-stop blends in CSS, see the CSS gradient generator.
Frequently asked questions
- What is a HEX color code?
- A HEX color code is a 6-digit hexadecimal number prefixed with # that represents RGB values. #ff0000 is red (255, 0, 0).
- Do I need to include the #?
- The # is optional. The tool accepts codes with or without it, typed or pasted.
- Can I convert a 3-digit HEX code?
- Yes. Each digit is doubled first, so #f80 is read as #ff8800 and converts to rgb(255, 136, 0).
- Does it accept 8-digit HEX codes with alpha?
- The converter reads 3 or 6 digits. For an 8-digit code, drop the last two digits (the alpha channel) to convert the opaque color.
Last reviewed September 30, 2026
Other pages for this tool
Related tools
- Background reading: Complete guide to color tools