Free Hex to RGB Converter
Convert any HEX color code to its RGB values instantly. Paste a 3- or 6-digit hex — with or without the # — and get the red, green, and blue channels plus a copy-ready rgb() value and a live preview swatch.
Channel values
How to Use the Hex to RGB
- Type or paste a HEX code like #22d3ee or 2de.
- The RGB values convert instantly as you type.
- Check the preview swatch to confirm the color.
- Click Copy to grab the rgb() value for your code.
Features
The converter accepts 3-digit shorthand (#2de), full 6-digit codes, and input with or without the leading hash, validating each character as you type. Output shows the three channel values individually plus the assembled rgb() function call, alongside a live swatch — everything updates on every keystroke with no button needed.
Benefits & Use Cases
Developers translating designer hex specs into canvas code, CSS rgba() overlays, or native app color APIs get exact channel values in one step. The live validation catches typos (like a 5-digit code or a stray “G”) immediately instead of failing silently downstream.
Tips
Need transparency? Take the RGB triplet and write rgba(34, 211, 238, 0.5) — the alpha value goes from 0 (invisible) to 1 (solid). For the reverse conversion, use the RGB to Hex tool.
Frequently Asked Questions
How do I convert HEX to RGB manually?
Split the 6-digit hex into three pairs; each pair is a base-16 number from 0 to 255. For example, #22d3ee gives red=0x22 (34), green=0xd3 (211), blue=0xee (238), i.e. rgb(34, 211, 238).
What is 3-digit HEX shorthand?
Each digit is doubled: #2de is the same as #22ddee. This tool expands shorthand automatically.
Why do I need RGB instead of HEX?
Some APIs and functions require separate channels — canvas fillStyle math, rgba() transparency, color interpolation in animations, and native mobile color constructors.
Is the conversion exact?
Yes. HEX is simply RGB written in hexadecimal, so the conversion is lossless in both directions.
Is my input sent anywhere?
No. Conversion runs entirely in your browser; nothing is uploaded or stored.
Related Tools
RGB to Hex
Turn RGB values into HEX codes with sliders or typed input. Free RGB to HEX converter with live preview — no sign-up needed.
Open tool →Color Code Converter
Convert colors between HEX, RGB and HSL instantly with NToolHub’s free converter. Live preview swatch, one-click copy — private and fast.
Open tool →CSS Gradient Generator
Build linear, radial and conic CSS gradients visually and copy the code. Free CSS gradient generator with live preview — no sign-up.
Open tool →Box Shadow Generator
Create soft, realistic CSS box shadows with sliders and copy the code. Free box shadow generator for web designers — no sign-up required.
Open tool →CSS Formatter
Beautify messy CSS instantly with NToolHub’s free CSS formatter. Clean indentation, readable rules, comment-safe — 100% private in-browser tool.
Open tool →