Free HEX to RGB Online

Convert HEX color codes to RGB, HSL, and other color formats. Preview colors in real-time.

Last updated
HEX#2563EB
RGBrgb(37, 99, 235)
HSLhsl(220, 83%, 53%)
RGBArgba(37, 99, 235, 1)

You picked a colour in Figma. Now your CSS file wants `rgb(34, 139, 230)` and your Tailwind config wants `#228be6` and your design tokens spec wants `rgba()` with an alpha channel — all the same colour, three different notations. Our free online HEX to RGB converter handles every direction at once: paste a HEX code and see RGB, RGBA, HSL, and HSLA appear instantly; paste an `rgb()` string and the HEX equivalent appears beside it. The colour is shown live in a preview swatch the moment you type, so you can sanity-check it against the design before you copy. Both 6-digit (`#228be6`) and 3-digit shorthand (`#28e`) HEX codes are accepted, with or without the leading `#`. The output panel keeps every notation visible at once with copy-to-clipboard buttons next to each, so whatever your stack expects — vanilla CSS, Tailwind, SCSS, styled-components, Flutter `Color(0xff...)`, Android XML, iOS UIColor — you can grab the right form in one click. Behind the converter is the formula every browser uses internally: split the HEX into three 8-bit channels, combine them with optional alpha, and run the standard HSL transform when needed. Real-world use cases come up daily: matching a brand colour from a PDF style guide that only shows HEX values; converting hand-coded CSS to use the new `oklch()` function; reading a colour out of a screenshot using a colour picker and pasting the result into a config file; debugging why your dark-mode background looks slightly off because someone wrote `#1a1a1a` in one file and `rgb(26, 26, 26)` in another. The HSL output is especially handy because it splits colour into hue, saturation, and lightness — three controls that map onto how humans actually think about colour, which makes it much easier to nudge a tone slightly warmer or slightly darker than fiddling with three RGB sliders. If you also need to build full palettes around a base colour, jump from here to the [Color Palette Generator](/tools/color-palette) to generate complementary, analogous, or triadic schemes. To pick a colour from a screenshot or live design first, the [Color Picker](/tools/color-picker) feeds straight into this converter. And if you are checking whether your final text colour will pass accessibility standards on a chosen background, run both values through the [Contrast Checker](/tools/contrast-checker) afterward. Everything happens in your browser — no upload, no signup, no daily limit.

How to Use HEX to RGB

1

Paste a HEX or RGB Value

Type a HEX code (with or without the #) or an rgb() / rgba() string into the input. Both 6-digit and 3-digit HEX shorthand are accepted.

2

See Every Format Side by Side

HEX, RGB, RGBA, HSL, and HSLA appear simultaneously, along with a live colour preview swatch matching the value you typed.

3

Copy the Format You Need

Each format has its own copy button. Click once to copy the exact string ready to paste into CSS, Tailwind, SCSS, or any other style sheet.

Features

Bidirectional Conversion

Paste a HEX code to get RGB/HSL, or paste an RGB string to get the HEX equivalent. The converter detects the input format automatically.

HEX, RGB, HSL, and Alpha

Outputs all five common notations: HEX, RGB, RGBA, HSL, and HSLA. Alpha defaults to 1.0 unless you set it explicitly.

Live Colour Preview

A swatch updates as you type so you can verify the colour visually before copying. No surprises when you paste it into your stylesheet.

Shorthand Support

Accepts 3-digit HEX shorthand like #28e and expands it to the full 6-digit form #2288ee, matching browser behaviour.

Benefits of Using HEX to RGB

Completely Free

Use HEX to RGB without any cost, limits, or hidden fees. No premium plans needed.

No Installation

Works directly in your browser. No software downloads or plugins required.

100% Private

Your files and data are processed locally. Nothing is uploaded to external servers.

Works Everywhere

Compatible with Chrome, Firefox, Safari, Edge on desktop, tablet, and mobile.

No Sign-Up

Start using the tool immediately. No account creation or email verification.

Always Available

Access this tool 24/7 from anywhere in the world, on any device.

Frequently Asked Questions

HEX-to-RGB is exact in both directions — both formats represent integer 0–255 channels. RGB-to-HSL involves floating-point arithmetic and is rounded to one decimal place for hue and integer percentages for saturation/lightness, which matches how browsers display computed styles.
Both forms work. The converter strips a leading # if present and otherwise treats the input as a HEX value. You can paste #ff0000 or ff0000 — the result is identical.
Each format reflects how humans or machines think about colour differently. HEX is compact and copy-paste friendly. RGB matches how monitors physically render colour. HSL maps onto perceptual properties — hue, how vivid, how light — making it the easiest format to tweak by hand. Designers usually pick the format that matches their current task.
The current version outputs sRGB-based formats (HEX, RGB, HSL). Wide-gamut perceptual functions like oklch() and lab() are on the roadmap once browser support stabilises across all evergreen targets.
Yes — input rgba(255, 0, 0, 0.5) and the output shows the corresponding HEX with the optional 8-digit alpha channel (#ff000080) plus HSLA. 8-digit HEX is supported by all modern browsers.
A colour picker lets you pick a colour visually from a screen, image, or palette. This converter takes a value you already have and translates it between formats. The two tools complement each other — pick with the [Color Picker](/tools/color-picker), then convert here.
CSS expands shorthand by repeating each digit: #28e becomes #2288ee, not #2080e0. This is the rule the browser follows, so the result you see here matches what your stylesheet will render.