HEX, RGB, HSL: one source of truth for design tokens
HEX, RGB, HSL, HSB 형식 간에 색상을 즉시 변환합니다. 시각적 색상 선택기 포함.
Click to pick
#6366f1rgb(99, 102, 241)hsl(239, 84%, 67%)HEX, RGB, HSL: one source of truth for design tokens
Converting between cylindrical (HSL) and cube-root models helps when a design system stores tokens in HEX but animation tweens in HSL for perceptual smoothness.
Gamut differences between displays mean on-screen matches are approximate; print workflows need CMYK profiles not covered here.
HEX, RGB and HSL describe the same colour
All three formats specify a colour in the sRGB colour space used by browsers. HEX is RGB written in base 16: #6366F1 means red 0x63 = 99, green 0x66 = 102 and blue 0xF1 = 241, so it is identical to rgb(99, 102, 241). HSL re-expresses the same colour as hue (an angle around the colour wheel, 0–360°), saturation and lightness (0–100%) — here hsl(239, 84%, 67%).
The converter accepts six-digit hex codes and the three-digit CSS shorthand, in which each digit is doubled: #FFF is #FFFFFF and #3A7 is #33AA77. Upper and lower case are equivalent.
Why HSL values do not always round-trip
HSL is shown in whole degrees and percentages, which is coarser than RGB. Converting #6366F1 to hsl(239, 84%, 67%) and back gives #6467F2 — one step brighter in each channel. The difference is invisible, but if you are matching a brand colour exactly, keep the HEX value as the source of truth and use HSL only for adjustments.
Using HSL to build a palette
- Lighter and darker shades: keep hue and saturation, change lightness — hsl(239, 84%, 90%) for a background tint, hsl(239, 84%, 40%) for hover states.
- Muted versions: lower the saturation while keeping hue and lightness.
- Complementary colour: add 180° to the hue. Triadic colours sit 120° apart, analogous colours 30° either side.
- Equal HSL lightness does not mean equal perceived brightness: yellow at 50% looks much lighter than blue at 50%. Check contrast rather than trusting the L value.
Checking text contrast
The Web Content Accessibility Guidelines (WCAG 2) require a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (about 24 px, or 19 px bold). Indigo #6366F1 on white measures 4.47:1 — just short for body text, though fine for large headings and buttons. A slightly darker #4F46E5 reaches 6.29:1. For neutral greys, #767676 is the lightest that passes 4.5:1 on white.
Screen and print
HEX, RGB and HSL describe light from a screen. Printing uses CMYK inks with a smaller range of reproducible colours, so very saturated screen colours — bright blues and greens especially — print duller. Ask your printer for their colour profile, or specify a Pantone reference, when an exact printed match matters.
Modern CSS colour syntax
Current CSS accepts space-separated values with an optional alpha after a slash — rgb(99 102 241 / 50%) and hsl(239 84% 67% / 0.5) — alongside the comma forms this tool outputs. Eight-digit hex adds alpha as the last two digits (#6366F180 is about 50% opacity); this converter works with opaque colours, so drop those two digits before pasting. Newer spaces such as oklch() describe colours more evenly for the eye and can reach wider-gamut displays, but HEX and RGB remain the common currency of design tools.
Related tools
These free tools pair well with this page — open them in a new tab to finish your workflow.
자주 묻는 질문
HEX, RGB, HSL의 차이점은 무엇인가요?
HEX는 CSS와 디자인 도구에서 주로 사용되는 6자리 16진수 표기법(예: #ff6600)입니다. RGB는 빨강·초록·파랑 채널을 0~255의 정수로 지정합니다. HSL은 색조(0~360°)·채도(0~100%)·명도(0~100%)로 색을 표현하며, 색을 조정할 때 사람에게 더 직관적입니다.
HEX를 RGB로 변환하는 방법은?
HEX 값을 두 자리씩 세 쌍으로 나눕니다: 첫 쌍이 빨강, 둘째가 초록, 셋째가 파랑입니다. 각 쌍을 16진수에서 10진수로 변환합니다. 예: #1a2b3c → R=0x1a=26, G=0x2b=43, B=0x3c=60, 즉 RGB(26, 43, 60).
불투명도/알파란 무엇인가요?
알파는 투명도를 제어하는 네 번째 채널(0~1 또는 0~100%)입니다. 0은 완전 투명, 1(100%)은 완전 불투명입니다. CSS에서는 rgba()나 hsla(), 또는 8자리 HEX(#rrggbbaa)로 표현됩니다.
화면과 인쇄물에서 색이 다르게 보이는 이유는?
화면은 가산 혼합 RGB 빛(빨강+초록+파랑=흰색)을 사용합니다. 프린터는 감산 혼합 CMYK 잉크(시안+마젠타+노랑+검정=검정)를 사용합니다. 같은 HEX 값이라도 장치마다 색 프로파일과 색역이 달라 보이는 방식이 다릅니다.
색역이란 무엇인가요?
색역은 장치가 재현할 수 있는 색의 범위입니다. sRGB가 가장 일반적인 웹 표준입니다. 와이드 색역 디스플레이(DCI-P3, Rec. 2020)는 더 선명한 색을 표시할 수 있습니다. 디스플레이 색역을 벗어난 색은 클리핑되거나 톤 매핑됩니다.
보색을 찾는 방법은?
보색은 색상환에서 정반대에 위치합니다. HSL에서는 색조 값에 180°를 더하거나 빼면 됩니다. 예: 색조 60°(노랑)의 보색은 색조 240°(파랑)입니다.
HEX 색상 코드는 대소문자를 구분하나요?
아니요. #FF6600과 #ff6600은 동일합니다. CSS는 HEX 색상 코드를 대소문자를 구분하지 않습니다. 그러나 많은 개발자와 스타일 가이드는 일관성을 위해 소문자를 선호합니다.