Convert HEX color codes to RGB and back
Type a HEX code like #FF5733 and instantly see the RGB equivalent — rgb(255, 87, 51). Or enter RGB values and get the HEX code. A live color swatch updates as you type, and one-click buttons copy the value in the format you need for CSS, design tools, or documentation.
Use this tool freeBrowser tool
Hex to RGB converter
Convert 3, 4, 6, or 8-digit HEX colors to RGB and RGBA values instantly. Nothing is uploaded.
Alpha: 1
How to use
Enter a color value
Type a HEX code (with or without the # symbol) or enter RGB values as three numbers from 0 to 255.
View the result
The opposite format field updates automatically. The preview swatch shows the color.
Copy
Click the copy button next to any value or CSS snippet. A toast confirms the text is on your clipboard.
Features
Bidirectional conversion
Enter a HEX code to get RGB, or enter RGB values to get HEX. Both fields update in real time as you type, with no need to click a convert button.
Live color swatch
A large preview swatch displays the color you entered. It updates instantly so you can visually confirm the shade matches what you expect.
CSS output snippets
Get ready-to-paste CSS code for color, background-color, and border-color properties in both HEX and RGB formats. Copy any snippet with one click.
Alpha channel support
Enter 8-digit HEX codes or RGBA values to work with transparency. The tool converts the alpha channel accurately between the two formats.
After this task
After this free tool, open Ai Enhance for the next AI editing workflow.
Continue with Ai EnhanceSpecifications
| Input formats | HEX (3, 6, 8 digit), RGB, RGBA |
| Output formats | HEX, RGB, RGBA |
| Alpha support | Yes (HEX8, RGBA) |
| CSS snippets | color, background, border |
| Preview | Live swatch |
| Processing | Client-side (instant) |
Related Magic Eraser Tools
Common questions
What is the difference between 3-digit and 6-digit HEX codes?
+
A 3-digit HEX code like #F53 is shorthand for #FF5533 — each digit is doubled. The tool accepts both forms and always outputs the full 6-digit code for clarity.
Can I enter HEX codes without the # symbol?
+
Yes. The tool recognizes HEX values with or without the leading hash. It will add the # to the output automatically.
How do I convert a color with transparency?
+
Use an 8-digit HEX code where the last two digits represent alpha (for example #FF573380 for 50% opacity) or enter four RGBA values. The tool converts the alpha channel between both formats.
Working with brand colors in photos?
AI Enhance can adjust photo colors to match your brand palette. Get the exact RGB values here, then use them as a reference when enhancing product photography.
Try it freeMore free tools
Explore our other limited free edits after sign-in photo and image tools.
Design linear, radial, and conic gradients with multiple color stops. Copy the CSS code or download as a PNG image.
Convert colors between HEX, RGB, HSL, HSB, CMYK, and CSS named formats. See a live preview, copy any value, and export a color card.
Pick any color from an uploaded image and get its HEX, RGB, and HSL codes instantly. Build palettes from photos for web design, branding, and illustration.
Upload a photo and extract 5-10 dominant colors with HEX, RGB, and HSL codes. Copy swatches, export as ASE or CSS variables.
Generate QR codes for URLs, text, WiFi credentials, and vCards. Customize colors, add a center logo, and download as PNG or SVG.
Calculate width, height, or aspect ratio for images and video. Enter any two values and get the third. Preset ratios for social media, film, and print.