Expand CSS hex shorthand
CSS lets you write a hex color in a compact 3-digit form, where #F80 is exactly the same color as #FF8800. This tool expands that shorthand — and the 4-digit alpha variant #RGBA — into the full canonical form by doubling each digit, validates the input, and previews the result with a live swatch. It is the quick way to normalize colors before storing or comparing them.
How it works
Expansion is a simple per-digit doubling: every single hex digit is repeated to form a byte. So #F80 expands as F to FF, 8 to 88, 0 to 00, giving #FF8800. The same rule applies to the 4-digit alpha shorthand, where the fourth digit becomes the alpha byte: #F80a becomes #FF8800AA. The tool first strips an optional leading hash, checks that the body is valid hex and a legal length (3, 4, 6, or 8), then either expands the short forms or passes the already-full forms through unchanged.
Example and notes
#abc expands to #aabbcc, and #0f08 expands to #00ff0088. Remember the key trick: doubling keeps the value proportional, which is why #F80 is not #F08000. Shorthand is lossy in reverse — only colors whose channels are doubled digits (16 levels each) can be shortened — so most real-world colors like #3b82f6 simply have no shorthand and must remain in long form.