RGB to Hex Converter
Turn an rgb() or rgba() color value into its hex equivalent and see hsl() alongside a color swatch.
How it works
- 1
Type or paste an rgb() or rgba() color value — both comma-separated and space-separated syntax are accepted.
- 2
A color swatch appears instantly alongside the matching hex code and HSL value.
- 3
Click any copy button to grab the notation you need. Processing stays in your browser.
Questions
What rgb() formats are accepted?
Integer channels like rgb(255, 128, 0), percentage channels like rgb(100%, 50%, 0%), and modern space-separated syntax like rgb(255 128 0) all work. Add a fourth value for alpha: rgba(255, 0, 0, 0.5).
Why does the tool also show HSL?
Showing all three notations at once saves you an extra conversion step — you get everything in one place.
Does this tool send data anywhere?
No. Conversion is done entirely in your browser; nothing you enter is transmitted.
More developer tools
JSON Formatter
Paste compact or messy JSON and get it back neatly indented with your chosen spacing.
JSON Minifier
Remove all whitespace and line breaks from a JSON document to shrink it as small as possible.
JSON Validator
Check whether a JSON string is well-formed, and see the exact line and column of any syntax error.
JSON Beautifier
Reformat JSON with sorted keys and readable indentation for easier reading and diffing.
JSON Tree Viewer
Explore a JSON document as an interactive collapsible tree — expand and collapse any node.
XML Formatter
Pretty-print XML with configurable indentation, preserving attributes, comments, and tag order.
XML Validator
Check XML for well-formedness and report every error with its line and column number.
YAML Formatter
Normalize and re-indent YAML, or convert it to JSON, with a configurable indent width.