Free tool · No sign-up

Free hex to RGB colour converter

Paste a hex colour code like #EF466F to get its RGB value, rgb(239, 70, 111), plus RGBA, HSL, 8-digit hex and code for SwiftUI and Jetpack Compose. It works the other way too: type RGB, RGBA or HSL and get the hex. Free, instant and no sign-up, for color and colour people alike.

Aa white text 3.64:1
Aa black text 5.77:1
RGB

rgb(239, 70, 111)

#EF466F

Other formats · click to copy
HEX#EF466F
HEX8#EF466FFF
RGBrgb(239, 70, 111)
RGBArgba(239, 70, 111, 1)
CSSrgb(239 70 111)
HSLhsl(345, 84%, 61%)
HSLAhsla(345, 84%, 61%, 1)
0–10.937, 0.275, 0.435
SwiftUIColor(red: 0.937, green: 0.275, blue: 0.435)
ComposeColor(0xFFEF466F)
Edit channels and opacity

Contrast uses the WCAG 2 formula: 4.5:1 is the AA minimum for body text, 3:1 for large text. Runs in your browser.

How do I convert hex to RGB?

  1. Paste or type a colour. Hex with or without the #, in 3, 4, 6 or 8 digits, or an rgb(), rgba() or hsl() value. Plain numbers like 239, 70, 111 work too.
  2. Or pick one. Use the colour picker, or type R, G and B values from 0 to 255 to convert RGB to hex.
  3. Set the opacity. Drag the alpha slider to get RGBA, HSLA and 8-digit hex values.
  4. Copy the format you need. Every row has a Copy button: hex for design tools, rgb() or hsl() for CSS, 0–1 values for code, and ready-made SwiftUI and Compose colours.

How does hex to RGB conversion work?

A hex colour is three pairs of hexadecimal digits: red, green and blue. Each pair runs from 00 (0) to FF (255). To convert, read each pair as a base-16 number:

ChannelHex pairSumDecimal
RedEF14 × 16 + 15239
Green464 × 16 + 670
Blue6F6 × 16 + 15111

So #EF466F is rgb(239, 70, 111). RGB to hex is the same in reverse: divide each value by 16 for the first digit and keep the remainder for the second. The CSS colour formats are defined in the W3C CSS Color Module Level 4; MDN has a friendly guide to the hex colour syntax.

Who is it for?

  • Web designers and developers moving colours between Figma (hex) and CSS (rgb, hsl or a transparent rgba).
  • iOS and Android developers who need a brand colour as SwiftUI Color(red:green:blue:) or Compose Color(0xAARRGGBB).
  • Brand and marketing teams filling in a style guide that lists every colour as hex, RGB and HSL.
  • Anyone checking accessibility: the contrast panel shows how readable the colour is on white and black.

Building a whole scheme? Try the colour palette generator, then preview it on a real screen with the app colour preview.

Which colour formats are supported?

FormatExampleWhere it is used
3 or 6-digit hex#F46, #EF466FDesign tools, CSS, brand guides
4 or 8-digit hex#EF466F80CSS with transparency (the last pair is alpha)
RGB / RGBArgba(239, 70, 111, 0.5)CSS, canvas, most design tools
Modern CSSrgb(239 70 111 / 50%)CSS Color Level 4 space-separated syntax
HSL / HSLAhsl(345, 84%, 61%)CSS, easy to make lighter or darker variants
0–1 values0.937, 0.275, 0.435Shaders, Unity, Figma plugins, many SDKs
SwiftUIColor(red: 0.937, green: 0.275, blue: 0.435)iOS and macOS apps
Jetpack ComposeColor(0xFFEF466F)Android apps (alpha first, then RGB)

Common colour names such as red or rebeccapurple are understood as input too. HSL values are rounded to whole numbers, so converting HSL back to hex can differ by one or two in a channel.

Tips and common mistakes

  • 8-digit hex puts alpha last in CSS (#RRGGBBAA) but Android and Compose put it first (0xAARRGGBB). Mixing them up is a classic bug; the tool shows both.
  • Hex is not case-sensitive. #ef466f and #EF466F are the same colour.
  • Use HSL to make tints and shades. Keep the hue and saturation, change the lightness, and your hover and pressed states stay on-brand.
  • Check contrast before you ship. A brand pink can look great as a button but fail as body text on white. Aim for at least 4.5:1 for normal text (WCAG 2.2, contrast minimum).

FAQ

How do I convert hex to RGB?

Split the hex code into three pairs and convert each from base 16 to a number from 0 to 255. #EF466F becomes 239, 70 and 111, or rgb(239, 70, 111). The converter does this instantly.

How do I convert RGB to hex?

Type the R, G and B values into the RGB to hex fields, or paste rgb(…) into the main box. The tool shows the hex code, such as #EF466F, ready to copy.

What is RGBA in hex?

It is an 8-digit hex code where the last two digits are the alpha (opacity). For example rgba(239, 70, 111, 0.5) is #EF466F80, because 50% of 255 rounds to 128, which is 80 in hex.

How do I convert hex to HSL?

Paste the hex code and copy the HSL row. #EF466F is hsl(345, 84%, 61%): a hue of 345 degrees, 84% saturation and 61% lightness.

Is it color or colour?

Both are right. Colour is the Australian and British spelling and color is American. CSS and most code always use color, so the tool accepts either kind of person.

Does the converter work offline?

Once the page has loaded, the conversion runs entirely in your browser, so it keeps working without a connection. Nothing you type is sent anywhere.

Ask AI about the hex to RGB colour converter

Opens your assistant with a question about this tool, answered from this page. You can edit it before you send.

Last updated 16 November 2026. Made by Sanket Singh at Digital Sauce in Melbourne. Found a bug or want a feature? Email development@digitalsauce.io.

Need a designer who also ships code?

Digital Sauce is a Melbourne studio that designs and builds apps and websites. We made these tools for our own projects.

Start a project →