What does the RGB ↔ Hex Converter do?
This tool helps designers and developers keep palette values consistent across design files and code. Three tabs cover the workflows you use most: RGB ↔ Hex links three numeric channels to a single hex field with two-way updates, Copy hex, and Copy rgb(). HSL ↔ Hex drives hue (0–360), saturation, and lightness with sliders plus numeric inputs, then shows the matching hex (read-only on that tab) for quick export. All formats accepts one pasted string—#RGB or #RRGGBB, rgb()/rgba() with the first three channels, or hsl()/hsla() with degrees or bare numbers—and prints a grid of ready-to-paste strings including rgba(..., 1), hsla(..., 1), and a sample --color-primary: #...; line.
How parsing and rounding work
Hex shorthand triplets expand to six digits before conversion. RGB inputs clamp to 0–255 when you type channel values. HSL ↔ RGB uses standard textbook conversion with rounding on displayed H/S/L to one decimal for readability. The flexible parser is intentionally small: if your string does not match its patterns, you will see “Could not parse color.” Adjust spacing or format and try again.
Privacy
All conversions run in your browser. Dynamic Duniya does not receive your color strings for this tool.