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 freeFeatures
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.
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.
Specifications
| 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.
Resize images to exact pixel dimensions for social media, web, and print. Sign-in required for free edits. Supports JPEG, PNG, and WebP up to 50 MB.
Compress JPEG, PNG, and WebP images by up to 80 % with minimal visible quality loss. Adjust the quality slider for full control. Sign-in required for free edits.
Convert PNG images to JPEG format instantly. Adjust output quality, pick a background color for transparent areas, and download — sign-in required.
Convert JPEG images to PNG format for lossless quality and transparency support. Ideal before background removal. Sign-in required; no install required.
Convert Apple HEIC and HEIF photos to universally compatible JPEG format. Works in the browser — no app install, sign-in required, no file uploads to a server.
Convert JPEG and PNG to WebP for faster page loads, or convert WebP back to JPEG/PNG for compatibility. Sign-in required, no install, runs in the browser.