This color code converter takes one color string and writes the other forms this page supports. It parses the text itself. It does not ask the browser whether a leftover color from the previous try still counts as success. An invalid string is an error, and the previous table and swatch are cleared.
Supported syntax is a closed set. Hex may be #rgb, #rgba, #rrggbb, or #rrggbbaa. rgb() and rgba() use commas. Channels are integers or decimals from 0 to 255, or percentages from 0% to 100%. hsl() and hsla() use commas. Hue is a number of degrees, with an optional deg unit. Saturation and lightness are percentages. Alpha is a number from 0 to 1, or a percentage. Named colors are the fixed CSS names shipped in the page, including the grey and gray spellings, plus transparent.
The swatch is painted from the numbers the parser produced, never from the raw paste. A six-digit hex is used when alpha is 1. Otherwise the swatch is an rgba() built from those numbers. Output rows are HEX, RGB or RGBA, HSL or HSLA, and alpha. When alpha is not 1, HEX is eight digits.
HSL in the result is not a copy of the hue you typed. The page turns the color into integer red, green, and blue, then rounds hue, saturation, and lightness from those channels. That is the same rounding as the Color Generator. The guide HEX, RGB, and HSL: How Color Values Relate already explains why a rounded HSL can sit a step away from a hand-tuned HSL. The generator still has no field for a color you paste. This page is that missing conversion. It does not draw a random color.
Empty input is an error. The limit is 200 characters. Space-separated rgb and slash alpha are rejected with a message to use commas. turn, rad, and grad are not accepted as hue units.
#fc0 is #ffcc00, rgb(255, 204, 0), and the HSL rounded from those integers, with alpha 1. #f008 expands to red with the alpha nibble repeated, so the HEX row is eight digits and the RGB row is rgba. rgb(100%, 0%, 0%) is #ff0000. hsl(0, 100%, 50%) is the same red after the integer round trip. rebeccapurple is the named color #663399. oklch(0.6 0.1 30) and color-mix(in srgb, red, blue) are errors, and a swatch from a previous success does not stay up.
#fc0
A percentage channel uses round(percent × 255 / 100). 50% is 128, not a fraction left in the RGB row. Alpha that is exactly 0 or 1 is shown as 0 or 1. Other alphas are shown to four decimal places, while an eight-digit hex keeps the nearest byte.
Wide-gamut spaces and color mixing are a different job. This page will not pretend a string it does not parse is “close enough” to sRGB. Invalid input clears the previous result so a failed try cannot be copied as if it had worked.
The converter does not generate a color, sample a pixel, or build a gradient. Those pages stay separate. Clear removes the paste and the swatch from the page. Nothing is stored.
Converts hex (#rgb, #rgba, #rrggbb, #rrggbbaa), comma-form rgb()/rgba() and hsl()/hsla(), and the named colors shipped in this page. HSL is rounded from the integer channels the same way as the Color Generator. oklch(), lab(), lch(), color(), color-mix(), and relative colors are not supported. The swatch uses the parsed color, not the raw text. Limit: 200 characters.
No. The generator draws a random color and has no paste field. This page converts a value you already have.
The page converts to integer red, green, and blue, then rounds HSL from those channels. That is the same rounding the Color Generator uses.
No. oklch(), lab(), lch(), color(), color-mix(), and relative color syntax are rejected.
The error replaces the previous result. The swatch is hidden. An old valid color is not left on screen.