Convert and check color codes in the Browser
Enter a color to sync HEX, HEX8, RGB, HSL, HWB, and OKLCH, and check opacity, color schemes, and contrast.
Open color picker/color code conversion toolConclusion: Split #RRGGBB into RR, GG, and BB, and map each to 00–FF and 0–255
In #0063C5, 00 is red = 0, 63 is green = 99, and C5 is blue = 197. It therefore represents the same sRGB color as rgb(0 99 197).
In 8-digit HEX, the final two digits are alpha. CSS uses #RRGGBBAA, not #AARRGGBB, so do not confuse platform-specific ordering.
To inspect the FF=255 calculation in more detail, you can also use the number-base conversion guide and tool.
Split HEX channels correctly
Remove the # from HEX, then read the six digits as pairs from the beginning. Each pair can be converted to decimal as 16 × the high digit + the low digit.
For shortened HEX, first repeat each nibble twice to expand it to six digits. For example, #f0a becomes #ff00aa.
| Item | How to check | judgment |
|---|---|---|
| Digit count | 3, 4, 6, and 8 digits | Process only supported formats |
| Channel | RR / GG / BB | Fix the order |
| Range | 00〜FF / 0〜255 | Within range |
| Alpha | Trailing AA | Separate from RGB |
Steps for converting HEX to RGB
- Enter HEX in the tool's HEX field.
- Check the synchronized HEX8, RGB, and HSL results.
- Copy the Modern CSS Syntax from the RGB field.
- Check whether the original colors match the preview.
The current tool also accepts input without #, but add # to HEX values pasted into CSS.
Manually convert 00, 63, and C5 to decimal
#0063C5
00 = 0 × 16 + 0 = 0
63 = 6 × 16 + 3 = 99
C5 = 12 × 16 + 5 = 197
rgb(0 99 197)
HEX, RGB, and HSL can represent the same sRGB color in different coordinates
| Representation | example | How to read |
|---|---|---|
| HEX | #0063C5 | Represent Red=00, Green=63, and Blue=C5 in hexadecimal. |
| RGB | rgb(0 99 197) | Represent Red, Green, and Blue as decimal values from 0 to 255. |
| HSL | hsl(209.8 100% 38.6%) | Represent the same sRGB color with hue, saturation, and lightness |
Correctly converted HEX, RGB, and HSL are basically the same sRGB color. Conversion does not create a different color; it changes the notation to one suited to the use case. However, converting again after rounding displayed digits in HSL and similar formats can shift RGB channels by about 1. Distinguish internal values from displayed values.
Treat alpha as a transparency channel separate from RGB.
| Alpha | 8bit HEX | meaning |
|---|---|---|
| 0% | 00 | Completely transparent |
| About 50% | 80 | 128 ÷ 255 = approximately 50.2% |
| 100% | FF | Completely opaque |
Eight-digit CSS HEX uses #RRGGBBAA, with alpha at the end. #ff000080 is red RGB with alpha 80; it is not #AARRGGBB. Converting 50% to an 8-bit integer yields 127.5, so the current tool uses Math.round to round it to 128, or 80.
Round only for display; do not increase error during conversion
- Map HEX channels as 00–FF and RGB channels as 0–255
- HSL retains internal float values and rounds hue, saturation, and lightness for display
- Verify that HEX→RGB→HEX produces the same value, and that RGB→HSL→RGB is within tolerance for the displayed precision
- When converting OKLCH to sRGB HEX, out-of-gamut correction may not guarantee the same appearance.
Even with the same CSS color value, actual appearance varies depending on display calibration, color profile, brightness, and ambient light. Judge numerical equality separately from perfectly identical appearance on every device.
Formats that can be input and output with the current color tool
| Item | Current tool operation |
|---|---|
| HEX | Accept #RGB, #RGBA, #RRGGBB, and #RRGGBBAA. Output uppercase 6-digit and 8-digit HEX. |
| RGB / HSL | Enter a number and convert it to Modern CSS rgb(... / alpha) and hsl(... / alpha) formats |
| HWB / OKLCH | Supports mutual conversion. Show a correction message when OKLCH is outside the sRGB gamut |
| Alpha | Synchronize a 0–100% slider with HEX8, RGB, HSL, HWB, and OKLCH. |
| Colors and saving | Complementary colors, analogous colors, triads, tint, shade, temporary palettes, and CSS Custom Property output |
| Contrast | Alpha composite the transparent foreground color onto the background, then display the WCAG ratio and AA/AAA results. |
| Unsupported | Named colors, LAB, LCH, Display P3, CMYK, color extraction from images, and automatic output of HEX shorthand candidates |
| Processing location | Process input colors and palettes in the browser, without sending or persistently storing them on the DevelopTools server. |
This implementation extracts numeric RGB input and normalizes it to 0–255 and Alpha to 0–1. It is not a strict Parser for all CSS or a Cascade diagnostic. Do not state that Named Colors or currentColor can be directly converted.
Final checks when applying to CSS
- Check Property names, semicolons, parentheses, #, and digit counts.
- Check the applied rule and overriding source in DevTools Computed Style
- Composite a foreground color with alpha over the actual background before calculating contrast.
- Do not convey state with color alone; also use text, icons, underlines, and similar cues
- Check appearance on PC and Smartphone, in Light/Dark Theme, and at the actual Font Size.
Color Converter is a tool for converting and comparing values. It does not automatically guarantee CSS specificity, the cascade, !important, pseudo-classes, browser support, or design quality.
Primary sources for the specification and accessibility
- W3C:CSS Color Module Level 4
- MDN:<hex-color>
- MDN:rgb()
- MDN:hsl()
- MDN:<named-color>
- MDN:oklch()
- W3C:WCAG 2.2 Contrast (Minimum)
CSS Color Level 4 defines HEX, rgb()/rgba(), hsl()/hsla(), HWB, named colors, OKLCH, and alpha. For contrast, refer to WCAG 2.2: as a Level AA guideline, normal text should generally be at least 4.5:1 and large text at least 3:1.
Example: convert #0063C5 to CSS rgb()
Convert the brand color from HEX to RGB and prepare for modern syntax that supports transparency.
An opaque color can be used as rgb(0 99 197), and 40% alpha as rgb(0 99 197 / 40%).
- Enter #0063C5
- Check RGB
- Preview comparison
- Copy to CSS
Adding alpha does not change the RGB channels themselves: they remain 0, 99, and 197.
Frequently asked questions
- Does the color change when converting between HEX and RGB?
- If the same sRGB values are converted correctly, only the representation differs. Small differences can occur when display digits for HSL and similar formats are rounded and converted again, or when adjusting from a wide color gamut to sRGB.
- Is the entered color code sent to the Server?
- The current color picker and color code conversion tool performs input, conversion, color matching, and contrast calculations in the Browser and does not send them to the DevelopTools Server.
- Does the color change between uppercase and lowercase HEX?
- #ABCDEF and #abcdef represent the same channel values. Standardize the notation according to the project's style rules.