HEX to RGB Converter
Convert colors between HEX, RGB, and HSL with a live preview swatch.
HEX to RGB Converter
Convert colors between HEX, RGB, and HSL with a live preview swatch.
Starts in your browser. Instructions are below.
How to use HEX to RGB Converter
- 01Type a hex color into the input, with or without the # sign.
- 02The RGB and HSL values and the preview swatch update as you type.
- 03Press Copy next to whichever format your stylesheet needs.
About HEX to RGB Converter
This HEX to RGB converter accepts 3, 6, or 8-digit hex codes and instantly shows the same color as RGB and HSL. HEX and RGB describe the same thing in different notation, three color channels from 0 to 255, so #ff0000 and rgb(255, 0, 0) are exactly the same color.
A 3-digit code like #0af is expanded automatically, and an 8-digit code adds an alpha channel shown as rgba(). HSL is often easier to work with by hand, because hue, saturation, and lightness are separate, so you can keep a hue and just change lightness to build a shade.
Paste a hex color from a design file to get the CSS value you need in whichever format your stylesheet already uses, with a swatch to confirm it looks right.
Frequently asked questions
- Does it accept shorthand hex codes?
- Yes, 3-digit codes such as #0af are expanded automatically, and 8-digit codes with an alpha channel are supported too.
- Which color format should I use in CSS?
- All three work. HSL is easiest to adjust by hand, HEX is the most compact.
- Can I enter a color without the # symbol?
- Yes, the converter accepts hex codes with or without the leading #.
- What does the preview swatch show?
- A solid block of the color you entered, so you can confirm it looks right before copying the value.
Related tools and tools
Color Palette Generator
Pick a base color and build a matching five-color palette you can copy as hex.
Unit Converter
Convert length, weight, temperature, volume, area, speed and data sizes instantly.
Markdown to HTML
Write markdown, preview it live, and copy the generated HTML.
Random Number Generator
Pick random numbers in any range, with or without duplicates.