Hex to RGB Converter
Convert HEX color codes to RGB values instantly. See RGB percentage, CSS code snippets, and a live color preview.
#FF5733
HEX Input
RGB Input
Output Formats
rgb(255, 87, 51)
rgb(100.0%, 34.1%, 20.0%)
rgb(255 87 51)
#FF5733
Individual Values
Red
255
100.0%
Green
87
34.1%
Blue
51
20.0%
CSS Code Snippets
color: rgb(255, 87, 51);
background-color: rgb(255, 87, 51);
color: #FF5733;
About Hex to RGB Converter
A HEX color code is a six-digit hexadecimal value — such as #FF5733 — used in CSS, HTML, SVG, and graphic design tools to identify a specific color. RGB is an additive model that expresses the same color as three decimal integers between 0 and 255, one for each of the red, green, and blue channels. Although both notations describe identical colors, design tools, code frameworks, and image editors each prefer one or the other, making conversion a routine step in any color-heavy workflow.
This Hex to RGB Converter translates any valid six-digit HEX code into its RGB equivalent in real time, showing the result in four distinct formats: the classic rgb(R, G, B) function, the percentage-based rgb(R%, G%, B%) variant, the modern space-separated CSS Level 4 syntax, and ready-to-paste CSS property declarations for both color and background-color. The tool is also fully bidirectional — type individual R, G, and B channel values (0–255) and it instantly computes the matching HEX code. A color picker lets you select any color visually and see all representations update at once.
Every calculation runs entirely inside your browser using JavaScript math — no color data is transmitted to any server. The conversion is instantaneous even for repeated color lookups, there is no account required, and the tool is free to use without limits. Individual channel values are displayed with both their 0–255 decimal figure and their percentage equivalent, giving you the full picture for any CSS or canvas-based work.
Key Features
Bidirectional conversion
Enter a HEX code to get RGB values, or type R, G, and B numbers to compute the HEX equivalent — both directions update live without clicking a button.
Four ready-to-paste output formats
Each conversion surfaces rgb(R, G, B), rgb(R%, G%, B%), modern space-separated CSS Level 4 syntax, and complete CSS property declarations so you can copy exactly the format your codebase expects.
Live color preview swatch
A large swatch renders the selected color in real time next to the inputs, so you can verify the shade visually before copying the value into your project.
Color picker integration
Use the native browser color picker to point at any color, and every output format — HEX, RGB, percentage, and CSS snippets — updates instantly to match your selection.
Individual channel readout
Each red, green, and blue channel is displayed separately with its 0–255 decimal value and percentage equivalent, which is useful for CSS custom properties, canvas APIs, and animation libraries.
Client-side only, no sign-up
Color values are never uploaded or logged. All conversion logic runs locally in your browser, making it safe to use with confidential brand colors or client design tokens.
How to Use
Enter a Color
Type a HEX code (e.g., FF5733) into the input field, use the color picker, or enter individual R, G, B values.
View Results
The converter instantly shows the RGB values, percentage format, CSS code snippets, and a large color preview swatch.
Copy & Use
Click any copy button to grab the format you need — RGB, CSS property, or HEX — and paste it directly into your project.
Example
The HEX code #1A73E8 — Google's primary blue — converts to rgb(26, 115, 232). Each pair of hex digits maps directly to one channel: 1A → 26 red, 73 → 115 green, E8 → 232 blue.
#1A73E8 rgb(26, 115, 232)
rgb(10.2%, 45.1%, 91.0%)
rgb(26 115 232)
color: rgb(26, 115, 232);
background-color: rgb(26, 115, 232); Common Use Cases
- arrow_circle_right
Translating design tokens from Figma to CSS
Figma exports and design handoff tools often surface HEX codes. Paste the token into the converter to get the rgb() value needed for CSS custom properties or Tailwind theme configuration that expects RGB channels.
- arrow_circle_right
Implementing CSS custom property color channels
Modern CSS patterns store RGB channels separately — e.g. --color-primary: 26 115 232 — so opacity variants like rgb(var(--color-primary) / 0.4) work. Use this tool to extract the three integers from any HEX token.
- arrow_circle_right
Setting colors in canvas, WebGL, or animation libraries
JavaScript APIs such as HTML Canvas, Three.js, and GSAP accept numeric RGB values, not HEX strings. Enter a HEX code here to get the three channel numbers for direct use in those APIs.
- arrow_circle_right
Verifying a specific color channel value
When debugging a color that looks slightly off — too red, too dark — inspect the individual channel readout to see exactly where it falls on the 0–255 scale and whether it matches the intended design value.
- arrow_circle_right
Bridging brand color palettes across print and screen tools
Brand guides often list colors in HEX, while some screen-focused tools (SVG filters, CSS gradients, React Native StyleSheet) require rgb() syntax. Use this converter as the quick bridge rather than computing hex math by hand.