Three-digit HEX repeats each digit
#369 is the same color as #336699. Repeat each digit twice; do not append zeros to make #306090. Its RGB value is rgb(51, 102, 153). The official CSS HEX rules are linked below.
Moyoutil trims surrounding spaces and a leading # before processing three- or six-digit HEX. Input is case-insensitive, and the result uses uppercase HEX. Changing the color picker or HEX input updates the preview and output.
Four inputs reproduced with the actual tool function
We ran the project’s color function on October 5, 2026. HSL below is the tool’s output rounded to integers. RGB contains the integer channel values decoded from the HEX input.
| Input | Output HEX | RGB | HSL |
|---|---|---|---|
#369 | #336699 | rgb(51, 102, 153) | hsl(210, 50%, 40%) |
#808080 | #808080 | rgb(128, 128, 128) | hsl(0, 0%, 50%) |
#123456 | #123456 | rgb(18, 52, 86) | hsl(210, 65%, 20%) |
#fff | #FFFFFF | rgb(255, 255, 255) | hsl(0, 0%, 100%) |
These are code conversion results, not measurements of a screen’s displayed color. Keeping the original HEX and RGB helps distinguish them from the precision of the displayed HSL.
A hue of zero does not make gray red
The tool shows a hue of zero for gray inputs. With saturation at 0%, however, hue does not change the displayed color. Do not interpret hsl(0, 0%, 50%) as red based on its first number alone. Read hue, saturation and lightness together.
Rounded HSL may not reproduce the original RGB
The tool displays #123456 as hsl(210, 65%, 20%). Converting that rounded HSL to sRGB, then rounding each channel to an integer in the 0–255 range, gives rgb(18, 51, 84), or #123354. The original is rgb(18, 52, 86), so two channels differ. This does not mean every color changes.
W3C CSS Color 4: Converting HSL to sRGB
When the exact original code matters, use the HEX or RGB output and keep the source value. Treat HSL as a starting point for adjustments, rather than treating this tool’s integer display as a lossless round-trip value. The tool does not accept HSL input to convert back to HEX.
Distinguish four- and eight-digit HEX from supported input
CSS also supports four- and eight-digit HEX with alpha. Moyoutil’s converter currently does not accept them: #12345678 and #abcd produce errors instead of RGB output. Removing the alpha digits discards transparency information, so it does not preserve the same color information.
W3C CSS Color 4: HEX with alpha
- Keep the original color code and note where it is used.
- Enter three- or six-digit HEX in the Color Converter and check the resulting HEX and RGB.
- Copy result copies three lines: HEX, RGB and HSL. Select the notation you need before using it.
- Consider rounding differences when reusing integer HSL. Check readability with the actual background and text combination separately.
This is a color code converter. It does not test contrast compliance, convert ICC profiles or convert colors to CMYK for printing.
Frequently Asked Questions
Can every six-digit HEX color be shortened to three digits?
No. Exact shorthand works only when both digits of each channel match. #336699 can become #369, but #123456 cannot be shortened that way.
Do identical HSL values look the same on every screen?
These comparisons cover code values and calculations. Converting a color code alone does not guarantee the same appearance on different screens or printed materials.