Source format does not match the tool
Conversions fail when the pasted input is not actually in the expected source format.
Fix: Verify the source format first, then paste it into the correct converter.
header • up to 320x100 / 728x90
Convert RGB color to HEX
Use a proper RGB field plus a live swatch instead of a freeform textarea.
content bottom • up to 300x250
sidebar • 160x600
Last reviewed:
RGB (Red, Green, Blue) is the additive color model used by digital screens, mixing light to create every visible on-screen color.
RGB to HEX Converter takes an rgb() or rgba() color value with 0–255 channel integers (or 0–1 normalized floats) and returns the equivalent 6-digit hex code. When an alpha channel is present, the output is an 8-digit hex including the alpha byte.
The tool accepts both the legacy comma-separated syntax (rgb(255, 128, 64)) and the modern space-separated syntax (rgb(255 128 64)), and understands percentage inputs (rgb(100%, 50%, 25%)).
Paste your RGB input so it can be converted into HEX for your next step.
Get HEX output converted from RGB that is ready to review, copy, or export into the next step of your workflow.
Conversions fail when the pasted input is not actually in the expected source format.
Fix: Verify the source format first, then paste it into the correct converter.
Broken rows, missing fields, or incomplete markup can block conversion.
Fix: Use a complete input sample with the structure intact before converting it.
Different target formats can flatten, restructure, or serialize values differently.
Fix: Review the converted output and confirm it matches the target system before using it downstream.
Yes. rgba(255, 128, 64, 0.5) becomes #ff804080 — the alpha float is multiplied by 255 and emitted as the last byte. For rgba with alpha 1 (or rgb with no alpha), the output is the standard 6-digit hex form.
Percentages are mapped to the 0–255 range — rgb(100%, 50%, 25%) becomes rgb(255, 128, 64), which then converts to #ff8040. The tool handles both input forms interchangeably.
No — channels must be in the 0–255 range (or 0–100% for percentages, or 0–1 for normalized floats). Values above the max are clipped with a visible warning; negative values are rejected because they have no meaningful hex representation.
Lowercase by default (matches the dominant convention in Tailwind, modern design systems, and most CSS-in-JS libraries). A toggle in the UI switches to uppercase for projects whose brand guidelines mandate it.
Yes. DevTools emits rgba(r, g, b, a) as its default RGB format, which is exactly what the converter expects. Paste the string as-is — no trimming needed.
If all three channel pairs repeat their first digit (e.g. #ff6644 → all high-high repeating), some CSS tools shorten to 3-digit form (#f64). Our converter always emits the full 6-digit form for unambiguous copy-paste; you can post-process with a separate 'hex shorthand' tool if you need the compressed form.
Continue the workflow with related tools for rGB to HEX, adjacent input and output steps, or other utilities in the same category. You can also browse the full Color Converters category for more options.
Convert HEX color to RGB
Convert RGB color to HSL
Convert RGB color to HSV
Convert RGB color to CMYK
Convert HEX color to HSL
Convert HEX color to HSV
Convert HSL color to HEX
Convert HSL color to RGB
Convert HSV color to HEX
Convert HSV color to RGB
Convert CMYK color to HEX
Convert CMYK color to RGB