RGB to HEX Converter
This free RGB to HEX converter turns red, green and blue values into a hex color code the moment you type them.
How to use
- Type or paste your RGB values — rgb() notation, comma-separated or space-separated.
- The uppercase HEX code appears instantly, with a leading # and no ambiguous lowercase digits.
- Copy the hex with one click and paste it wherever a color code is expected.
Frequently asked questions
How does the conversion work?
Each channel is written in base 16 and joined: 255 becomes FF, 165 becomes A5 and 0 becomes 00, giving #FFA500. Every integer from 0 to 255 maps to exactly one two-digit hex pair, so the conversion is lossless in both directions.
Why is the output uppercase?
Hex digits are case-insensitive in CSS and SVG, so #ffa500 and #FFA500 are the same color. Uppercase is the conventional spelling in style guides and diff-friendly in version control, so this tool always outputs uppercase with a leading hash.
What inputs are accepted?
Three common spellings: rgb(255, 165, 0) with the wrapper, bare comma-separated 255, 165, 0, and space-separated 255 165 0. Values must be whole numbers from 0 to 255 — decimals, negatives and values above 255 are rejected with a clear error.
Do you support rgba with transparency?
No — this tool converts opaque RGB colors only. An input with four values is rejected rather than silently dropping the alpha channel, which would hand you a color that renders differently than your source.
Related tools
About this tool
This free RGB to HEX converter turns red, green and blue values into a hex color code the moment you type them. Design tools, CSS files and color pickers are split between the two notations: JavaScript gives you channels as numbers, but a style guide, an SVG fill or a Tailwind config usually wants #FFA500. Paste rgb(255, 165, 0), or the bare 255, 165, 0, or even space-separated 255 165 0 — the converter understands all three and outputs the uppercase hex code with a leading hash, the exact spelling that round-trips cleanly through version control, design tokens and documentation. Out-of-range values are rejected with a clear error instead of being silently clamped, because a channel of 300 or 12.5 is a bug in your code and deserves a loud failure, not a neighboring color. Everything is computed locally in your browser: your values never leave your device, and nothing is uploaded, stored or logged. Paste your RGB values below and copy the hex you need.