Converter

Free HEX to RGB Converter

Convert any HEX colour code to RGB instantly. Also outputs HSL, HSV and CMYK — with live preview and batch conversion for multiple codes at once.

Live conversion 100% offline Batch mode Live preview

HEX Input

#2563EB
#
Invalid HEX code. Use 3 or 6 hex digits (0–9, A–F).
Recent conversions
No conversions yet — enter a HEX code above.

RGB Output

RGB colour
rgb(37, 99, 235)
Red
37
25
Green
99
63
Blue
235
EB
Other formats
HEX #2563EB
HSL hsl(221, 83%, 53%)
HSV hsv(221, 84%, 92%)
CMYK cmyk(84%, 58%, 0%, 8%)

About HEX to RGB Conversion

HEX and RGB are two ways of writing the same colour. A HEX code like #2563EB encodes three colour channels as pairs of hexadecimal digits. An RGB value like rgb(37, 99, 235) encodes those same three channels as decimal numbers from 0 to 255. The colour is identical — only the notation differs.

Design tools, brand guidelines and copy-pasted code snippets tend to mix both formats. This converter lets you move between them instantly, along with the other common colour formats you'll encounter.

How HEX to RGB conversion works

A six-digit HEX code is three pairs of hexadecimal digits, in the order R, G, B. Each pair ranges from 00 (0) to FF (255). To convert, read each pair as a base-16 number and write the result in base-10.

HEX digitsChannelHex → DecimalRGB value
25Red2×16 + 5 = 3737
63Green6×16 + 3 = 9999
EBBlue14×16 + 11 = 235235

So #2563EB becomes rgb(37, 99, 235). The process is fully reversible and lossless — every HEX code maps to exactly one RGB triplet and vice versa.

Reference values

ColourHEXRGB
Black#000000rgb(0, 0, 0)
White#FFFFFFrgb(255, 255, 255)
Red#FF0000rgb(255, 0, 0)
Green#00FF00rgb(0, 255, 0)
Blue#0000FFrgb(0, 0, 255)
Mid grey#808080rgb(128, 128, 128)

3-digit shorthand

CSS also supports a 3-digit shorthand where each digit is doubled. #F0C is exactly the same as #FF00CC. This converter expands shorthand automatically, so #F0C and #ff00cc both work.

When to use HEX vs RGB

Common use cases

CSS in JS

Convert design tokens from HEX to RGB for runtime manipulation.

Canvas & WebGL

Graphics APIs expect RGB or normalized channel values.

Batch processing

Convert an entire palette or design system at once.

Print preparation

Get CMYK equivalents from source brand hex codes.

Accessibility

Compute channel values for contrast calculations.

Documentation

Produce colour specs in the format each team needs.

Privacy and accuracy

This HEX to RGB converter runs entirely in your browser. All conversions happen locally in JavaScript with no server calls. The colour codes you enter are never transmitted, stored or logged.

Frequently Asked Questions

How do I convert a HEX code to RGB?
Split the 6-digit hex code into three 2-digit pairs, then convert each pair from base 16 to base 10. For example, #2563EB splits into 25, 63 and EB. 25 in hex is 37 in decimal, 63 is 99, and EB is 235. So #2563EB becomes rgb(37, 99, 235).
What does each pair of digits in a HEX code mean?
A 6-digit HEX code is three pairs of digits, in order: red, green, blue. Each pair ranges from 00 (no colour) to FF (full intensity). #FF0000 is pure red, #00FF00 is pure green, #0000FF is pure blue, #FFFFFF is white and #000000 is black.
What is the difference between 3-digit and 6-digit HEX?
A 3-digit HEX like #F0C is shorthand for a 6-digit code where each digit is doubled: #F0C becomes #FF00CC. This tool expands shorthand automatically, so both formats work.
Can I convert multiple HEX codes at once?
Yes. Switch to Batch mode, paste as many hex codes as you like (one per line, or separated by commas and spaces), and the tool converts them all in one go. The output is a clean list you can copy.
Does HEX to RGB lose precision?
No. HEX and RGB are two ways of representing the exact same three channel values. HEX is base-16 and RGB is base-10, but the underlying data is identical. The conversion is lossless and reversible.
Why would I use RGB instead of HEX?
RGB is often easier to work with in code — you can manipulate the red, green and blue channels individually. JavaScript canvas, WebGL and some CSS animation libraries prefer RGB. HSL is even easier for adjusting colours by hand. Use whichever format fits your workflow; the colour is identical.
Is this HEX to RGB converter free?
Yes, it is 100% free, requires no sign-up and runs entirely in your browser. No length limits, no watermarks, no premium tier.
Is my data sent to a server?
No. All conversions happen locally in JavaScript. The colour codes you enter are never transmitted, stored or logged.

Related Colour Tools

Done!