HEX to RGB Converter

HEX to RGB converter: convert any hex color code into RGB values instantly for CSS, design, and styling work. Free, private, runs in your browser, no signup.

Enter a 3 or 6 digit hex color code. The converter runs entirely in your browser.

Updates automatically as you type.

Calculated in your browser; your inputs are not sent to us. Privacy

Results will appear here.
Calculation details
Every figure above is calculated locally in your browser from the assumptions shown. No inputs are sent anywhere. See the methodology section below for how this tool works.
Use this resultShare the current inputs, or ask ChatGPT to explain the calculation in context.
Ask an AI to explain this result
Share this result

Planning estimate only, not financial, tax, or legal advice. Verify assumptions and current rules before making decisions.

This tool runs in your browser. Your calculator inputs and results are never transmitted to us or to ad/affiliate partners. Ads and sponsored links may set third-party cookies to serve and measure them, but they never receive your calculation values. If you explicitly save a scenario, its permitted fields stay in local browser storage until you clear them. See our Privacy Policy.

Use this result

Share the current inputs or ask ChatGPT to explain the calculation in context.

More options
Report a calculation issue
Direct answer

What does this calculator estimate?

HEX to RGB converter: convert any hex color code into RGB values instantly for CSS, design, and styling work. Free, private, runs in your browser, no signup.

Transparent methodology

How this calculator works

Frequently asked questions

How does a hex to rgb converter work?

A hex to rgb converter translates hexadecimal color codes into RGB values by splitting the code into its red, green, and blue components.

Do I need to create an account to use this hex to rgb converter?

No, this is a no-signup tool that runs entirely in your browser, so you don't need to create an account.

Is my data safe when using this hex to rgb converter?

Yes, because it is a browser-based tool, all conversions happen locally on your device and no data is stored or transmitted.

Cite this tool

BoringToolsKit. “HEX to RGB Converter.” boringtoolskit.com/hex-to-rgb/. Free to reference in articles, syllabi, and answer posts with a link.

Privacy: Inputs and results stay in this browser. Any future sponsored recommendation or advertisement will be clearly labeled and kept separate from the calculation.

Worked example: converting #2563eb step by step

The formula works by stripping the # sign, expanding 3-digit shorthand, then slicing the 6-digit string into three two-digit chunks. Take #2563eb. After removing the #, the hex string is 2563eb. Each pair is a base-16 number: the first pair 25 means 2 x 16 + 5 = 37, so Red: 37. The second pair 63 means 6 x 16 + 3 = 99, so Green: 99. The third pair eb is 14 x 16 + 11 = 235, because e is 14 and b is 11 in hex, so Blue: 235.

The final CSS line is rgb(37, 99, 235), which is Tailwind's blue-600. You can check it in reverse: 37 x 65536 + 99 x 256 + 235 = 2,424,939, and 0x2563eb = 2,424,939. The same input in 3-digit form, #253, would expand to 225533 and give rgb(34, 85, 51), a dark green, so shorthand and longhand are never interchangeable unless each digit is doubled.

A gray shortcut: any string where both digits of each pair match, like #808080, gives equal channels, here rgb(128, 128, 128). If the two digits differ even slightly, such as #7f7f80, the result is rgb(127, 127, 128) and the eye still reads gray, but the hex is no longer a gray code.

Limits the conversion does not cover

The parser accepts exactly 3 or 6 hex digits after an optional #. It rejects 4-digit and 8-digit RGBA shorthand like #2563eb80, which browsers accept as colors with alpha, and it accepts 3 digits where most design tools expect 6, so #f00 correctly resolves to rgb(255, 0, 0). Uppercase letters work because the regex tests a-fA-F, but a stray space inside the string, hex with 1, 2, 5, or 7 digits, or a leading 0x all fail and return the error message rather than a guess.

This is RGB only. The calculator cannot produce HSL, CMYK, or perceptual values, and it makes no statement about contrast. Two results that look identical on screen, rgb(37, 99, 235) and rgb(37, 99, 236), differ by one unit in blue yet sit on the same side of the WCAG threshold, while a one-step shift on a boundary color can flip an AA pass to a fail. Channel values are integers 0 to 255 because the bit shifts mask to 8 bits; there is no path to fractional or out-of-range values.

Practically, the output is the raw sRGB triple. Color management, the difference between sRGB and Display P3, and gamma encoding all happen outside this conversion, so the same hex can render slightly differently across devices.