Output will appear here
Click in the output to select all text
Output will appear here
Click in the output to select all text
Convert HEX color codes (#RRGGBB, #RGB) to RGB / RGBA values.
Convert RGB / RGBA color values to 6-digit or 8-digit HEX codes.
Convert simultaneously across HEX, RGB, RGBA, HSL, HSLA, HSV, CMYK, and HWB formats.
Lookup standard W3C CSS named colors and convert them to HEX, RGB, and HSL.
Visual color picker showing real-time HEX, RGB, HSL, HSV, and CMYK formats.
Scan CSS stylesheets and extract a comprehensive palette of all unique color codes.
This HEX code validator checks whether a color code is correctly formatted as 3-digit, 6-digit, or 8-digit hexadecimal, flags any invalid characters or malformed input, and normalizes the result into a clean, standardized format. It's useful for developers reviewing user-submitted color values, QA teams checking design tokens or CSS files for consistency, and anyone unsure whether a hex string they copied is actually valid. Paste any hex code, with or without the leading #, and the tool instantly tells you whether it's valid, identifies its format (shorthand, full, or with alpha), and shows the normalized version - for example, expanding #f0c to #ff00cc. Everything runs locally in your browser, so pasted color values and design files never leave your device. Validation checks strictly follow the CSS Color Module hex syntax rules, so a code marked valid here will always be interpreted correctly by browsers and design tools. Paste your hex code below to validate and normalize it.
A valid hex color code consists of a # followed by exactly 3, 4, 6, or 8 hexadecimal digits (0-9 and A-F), representing RGB or RGBA channels.
Each digit in a 3-digit shorthand is duplicated to form the full 6-digit code - for example, #abc normalizes to #aabbcc.
No, hex codes only allow the characters 0-9 and A-F; letters like G, H, and I are invalid and will be flagged by this validator.
In CSS, the # is required, but this tool accepts input without it and will normalize the result to include the # for you.
A 4-digit hex code (#RGBA) is a shorthand format that includes an alpha/transparency digit alongside the shorthand RGB digits.
Common causes include an incorrect number of digits, invalid characters outside 0-9 and A-F, or missing digits entirely - all of which this tool flags immediately.