Enter a 3 or 6 digit hex color code. The converter runs entirely in your browser.
Calculation details
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.
What does this calculator estimate?
A HEX to RGB converter turns hex color codes into CSS rgb() values. Enter a 3- or 6-digit hex code to see the RGB breakdown.
- #RRGGBB → three bytes (0–255)
- #2563eb = rgb(37, 99, 235)
- Accepts 3-digit shorthand (#fff)
How hex colors encode RGB
Hex colors pack three color channels into six hex digits: two per channel (0–255 in decimal). #2563eb means red 0x25 (37), green 0x63 (99), blue 0xeb (235). The 3-digit shorthand doubles each digit (#f00 = #ff0000).
Limitations to watch for
The tool expects valid hex — letters A–F and digits 0–9 only. It converts, it doesn't name colors or check contrast (use the contrast calculator for readability). CSS also supports rgb() and hsl() directly, which don't need conversion.
How to use it in practice
Paste a hex code from a design tool into the converter for the rgb() form, or use the RGB values in code and CSS. For color-picking and contrast checks, use the color picker and contrast ratio tools.
['Enter the hex code (with or without #).', 'The tool converts to RGB bytes.', 'Copy the CSS rgb() value.']
How this calculator works
Formula
Splits a hex color into its red, green, and blue bytes: #RRGGBB → (RR₁₆, GG₁₆, BB₁₆) in decimal (0–255). 3-digit shorthand expands each digit.
Worked example
#2563eb = rgb(37, 99, 235) — the blue-600 Tailwind color.
Assumptions to verify
- The hex code is valid (#RRGGBB or shorthand).
- The conversion targets CSS rgb().
- No alpha channel is modeled.
Frequently asked questions
How do I convert hex to RGB?
Split the code into three pairs and convert each from hex to decimal: #2563eb = rgb(37, 99, 235).
What is the # format?
Six hex digits, two per channel: #RRGGBB. Each channel ranges 00–FF (0–255).
What is 3-digit shorthand?
#fff expands to #ffffff by doubling each digit — shorthand for colors with repeated pairs.
What's the difference from hex to decimal?
The hex-to-decimal tool converts a single number; this converts a color code into its three channel values.
How do I use the rgb() value?
Paste it directly into CSS: background: rgb(37, 99, 235);
Does it handle alpha/opacity?
No — for alpha use rgba() or the 8-digit hex form.
How do I check if the color passes contrast?
Use the contrast ratio calculator with the background color.
Cite this tool
BoringToolsKit. “HEX to RGB Converter.” boringtoolskit.com/hex-to-rgb/ (reviewed 2026-08-25). 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.