← Maths Tools

Hex & RGB Color Converter

Convert hex colour codes to RGB values and back — instant, no sign-up required.

Convert colours between HEX, RGB, HSL, HSV, and CMYK formats instantly.

Click to open picker
#
RGB
rgb(85, 54, 253)
HSL
hsl(249, 98%, 60%)
HSV
hsv(249, 79%, 99%)
CMYK
cmyk(66%, 79%, 0%, 1%)
Advertisement
Ad space — 728×90

</> Embed this calculator

Free to embed on any website — no sign-up needed. Paste this snippet where you want the calculator to appear.

<div class="yootil-widget" data-tool="hex-rgb-converter"></div> <script src="https://yootils.com/widgets/v7/widgets.js" integrity="sha384-+/J+UJUQkd8qBlJ2y9qW3wNk89iZUobwuVdo6dqpCvoanps684ZTa7cGCJ5L1AQc" crossorigin="anonymous" async></script>

Browse all embeddable widgets → How to install it →

How to Convert Between Hex and RGB Colour Codes

HEX & RGB

Hex codes like #FF5733 represent the same values as RGB — red, green, and blue channel intensities from 0–255. FF = 255 in hex. Used in web development (CSS, HTML). For a deeper look at how hex works as a numbering system, see the base converter.

HSL

HSL stands for Hue, Saturation, Lightness. Hue is the colour angle (0–360°), saturation is the intensity (0–100%), and lightness ranges from black (0%) through the colour to white (100%). Intuitive for designers.

HSV / HSB

HSV (also called HSB) uses Hue, Saturation, and Value (Brightness). Unlike HSL, full saturation + full value gives a pure colour (not white). Used in colour pickers in design tools like Photoshop and Figma.

CMYK

CMYK (Cyan, Magenta, Yellow, Key/Black) is a subtractive colour model used in printing. When inks are combined they absorb light, producing darker colours. The K (black) channel prevents muddy results when all three mix.

Worked example

Enter #FF6B35: RGB = (255, 107, 53), HSL = (19°, 100%, 60%), HSV = (19°, 79%, 100%), CMYK = (0%, 58%, 79%, 0%). Or enter RGB (85, 54, 253): hex = #5536FD, HSL = (249°, 98%, 60%). To darken this colour by 15%, change HSL lightness from 60% to 45% while keeping hue and saturation unchanged.

Related calculations

For number bases beyond colour codes — binary, octal, or any base up to 36 — use the base converter. Hex colour codes are simply base-16 numbers, so the same arithmetic underlies both.

Frequently Asked Questions

How do I convert a hex colour code to RGB?

Enter the hex code (with or without #) in the converter and it instantly shows RGB, HSL, HSV, and CMYK values. Manually: split the 6-digit code into three pairs — for #FF5733, that's FF (red) = 255, 57 (green) = 87, 33 (blue) = 51, giving RGB(255, 87, 51).

What is the difference between RGB and HEX colour codes?

RGB and HEX represent the same colour information — red, green, and blue channel intensities from 0 to 255. HEX is simply a compact base-16 representation of those same values. Both are used in CSS and HTML; HEX is common in design tools, while RGB is useful for precise numeric control.

What is HSL and when should I use it?

HSL (Hue, Saturation, Lightness) is more intuitive for designers: adjust lightness or saturation without affecting the hue. It is natively supported in CSS and useful when programmatically generating colour variations — for example, creating darker or lighter shades of a brand colour.

What is CMYK and how is it different from RGB?

CMYK is a subtractive model used in printing — inks absorb light to produce colour. RGB is additive — mixing light produces colour for screens. Converting between them is approximate because the gamuts (reproducible colour ranges) of print and screen do not perfectly overlap. To calculate colour mix percentages, try the percent calculator.

See all Maths tools →

Evidence & Methodology

How This Page Is Grounded

Method

Maps each two-digit hexadecimal colour channel to its decimal red, green and blue value, and performs the inverse conversion.

Important limitation: The values describe encoded sRGB channels; perceived colour also depends on display and colour management.

Primary Sources

  1. CSS Color Module Level 4 World Wide Web Consortium

Quality Checks

Shorthand expansion, channel limits and hex/RGB round trips are checked.

Built and maintained by
Published by
yootils
Source authority
World Wide Web Consortium
Last reviewed

See how sources are selected and corrections are handled in our Editorial & Calculation Methodology, and which automated checks this page has to pass in How We Test.