Color Converter

Convert between HEX, RGB, and HSL color codes with live preview.

๐Ÿ“– How to Use

1
Select a Color

Use the color picker or enter a HEX code directly (e.g. #4f46e5).

2
View Converted Values

RGB and HSL values are automatically calculated and displayed.

3
Copy or Randomize

Click on any field to copy its value. Click ๐ŸŽฒ Random Color to generate a random color.

๐Ÿ’ก Tip: HEX is the most common color format in web design, while RGB and HSL are frequently used in CSS for dynamic color manipulation.

About the Color Converter

A color on the web is ultimately a mix of red, green, and blue light on an emissive screen — an additive RGB model where full intensity of all three channels yields white. CSS exposes three interchangeable notations for this sRGB color space: HEX, RGB, and HSL. This converter lets you type or pick any color and see its representation in all three, so a value from a design tool can be pasted straight into a stylesheet.

How it works

HEX writes each of the three channels as two hexadecimal digits: #RRGGBB, each pair ranging from 00 (0) to FF (255). CSS Color 4 also allows an 8-digit form, #RRGGBBAA, whose last pair encodes alpha — FF opaque, 00 transparent. RGB spells the channels as decimal triplets, rgb(r, g, b), again 0–255. HSL takes a different angle: hsl(h, s%, l%) uses hue as an angle from 0–360° around the color wheel (0 red, 120 green, 240 blue), with saturation and lightness as percentages.

Conversions are pure arithmetic. To go HEX→RGB, split the string into three pairs and read each as a base-16 number. To go RGB→HSL, normalize each channel to 0–1, derive lightness from the max and min, then saturation from the spread, and finally the hue from which channel peaks. Two caveats: monitors vary, so identical numbers render slightly differently across hardware (gamma and color management apply); and if you use the alpha channel, keep the background in mind — alpha blends against whatever sits behind the element.

Common use cases

  • Translating a designer's HEX token into hsl() to derive hover and disabled states
  • Reading an rgb() value from devtools and pasting it into a CSS variable
  • Picking a brand accent and grabbing the 8-digit #RRGGBBAA form for a translucent overlay
  • Tuning HSL lightness for predictable, accessible contrast ratios

Worked example

Take the indigo #4f46e5. Split into pairs 4f, 46, e5 and convert each from base 16:

4f=79  46=70  e5=229
#4f46e5 = rgb(79,70,229)

Applying the HSL formulas gives:

#4f46e5 = hsl(244,76%,59%)

The same color, three notations — identical pixel, different ergonomics.

Frequently asked questions

What is the difference between HEX, RGB, and HSL?

HEX packs each channel into two hex digits (#RRGGBB). RGB lists the same three channels as decimal values from 0 to 255. HSL describes a color with hue (0–360 degrees on the color wheel), saturation, and lightness as percentages. All three describe the same sRGB color, just in different coordinate systems.

What does the 8-digit HEX code include?

An 8-digit HEX such as #RRGGBBAA adds an alpha channel as the final two hex digits, where FF is fully opaque and 00 is fully transparent. It is supported in CSS Color 4 and lets you encode opacity without a separate opacity property.

How do I convert HEX to RGB?

Split the 6-digit HEX into three pairs and read each pair as a base-16 number. For #4f46e5 the pairs are 4f, 46, and e5, which equal 79, 70, and 229, giving rgb(79, 70, 229).

Is HSL better than RGB for adjusting colors?

Yes, for human adjustments. HSL separates the perceived hue from saturation and lightness, so you can darken or desaturate a color predictably. RGB forces you to balance three correlated channels, which is harder to reason about.

Are the converted colors sent to a server?

No. All conversions run in your browser through plain JavaScript arithmetic on the channel values. Nothing is uploaded, so the tool is safe to use with brand palettes and proprietary design tokens.

์ƒ‰์ƒ ๋ณ€ํ™˜๊ธฐ๋ž€?

์›น์—์„œ ํ•˜๋‚˜์˜ ์ƒ‰์€ ๊ฒฐ๊ตญ ๋น›์„ ๋‚ด๋Š” ํ™”๋ฉด์—์„œ ๋นจ๊ฐ•ยท์ดˆ๋กยทํŒŒ๋ž‘ ๋น›์„ ์„ž์–ด ๋งŒ๋“  ๊ฒฐ๊ณผ์ž…๋‹ˆ๋‹ค — ์„ธ ์ฑ„๋„ ๋ชจ๋‘ ์ตœ๋Œ€ ๊ฐ•๋„์ผ ๋•Œ ํฐ์ƒ‰์ด ๋˜๋Š” ๊ฐ€์‚ฐ ํ˜ผํ•ฉ(additive) RGB ๋ชจ๋ธ์ž…๋‹ˆ๋‹ค. ๋””์ž์ด๋„ˆ๊ฐ€ ์ด ๋‚ ๊ฒƒ์˜ ์ˆซ์ž๋ฅผ ๋งค๋ฒˆ ๋‹ค๋ฃจ๊ธด ์–ด๋ ต๊ธฐ ๋•Œ๋ฌธ์—, CSS๋Š” ๋™์ผํ•œ sRGB ์ƒ‰์˜์—ญ์„ ์„ธ ๊ฐ€์ง€ ์ƒํ˜ธ ๊ตํ™˜ ๊ฐ€๋Šฅํ•œ ํ‘œ๊ธฐ๋ฒ•์œผ๋กœ ๋…ธ์ถœํ•ฉ๋‹ˆ๋‹ค. ๋ฐ”๋กœ HEX, RGB, HSL์ž…๋‹ˆ๋‹ค. ์ด ๋ณ€ํ™˜๊ธฐ๋Š” ์ƒ‰์„ ๊ณ ๋ฅด๊ฑฐ๋‚˜ ์ž…๋ ฅํ•˜๋ฉด ์„ธ ํ‘œ๊ธฐ๋ฒ• ๋ชจ๋‘๋กœ ์ฆ‰์‹œ ๋ณด์—ฌ ์ฃผ์–ด, Figma ์ธ์ŠคํŽ™ํ„ฐ์—์„œ ์ฝ์€ ๊ฐ’์„ ์Šคํƒ€์ผ์‹œํŠธ์— ๊ทธ๋Œ€๋กœ ๋ถ™์—ฌ๋„ฃ๊ฑฐ๋‚˜ ๊ทธ ๋ฐ˜๋Œ€ ์ž‘์—…์„ ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด ์ค๋‹ˆ๋‹ค.

์ž‘๋™ ๋ฐฉ์‹

HEX๋Š” ์„ธ ์ฑ„๋„ ๊ฐ๊ฐ์„ 16์ง„์ˆ˜ ๋‘ ์ž๋ฆฌ๋กœ ํ‘œ๊ธฐํ•ฉ๋‹ˆ๋‹ค. #RRGGBB์—์„œ ๊ฐ ์Œ์€ 00(0)๋ถ€ํ„ฐ FF(255)๊นŒ์ง€์ž…๋‹ˆ๋‹ค. CSS Color 4๋Š” 8์ž๋ฆฌ ํ˜•ํƒœ์ธ #RRGGBBAA๋„ ํ—ˆ์šฉํ•˜๋ฉฐ, ๋งˆ์ง€๋ง‰ ์Œ์ด ์•ŒํŒŒ(๋ถˆํˆฌ๋ช…๋„)๋ฅผ ๊ฐ™์€ ๋ฐฉ์‹์œผ๋กœ ์ธ์ฝ”๋”ฉํ•ฉ๋‹ˆ๋‹ค — FF๋Š” ์™„์ „ํžˆ ๋ถˆํˆฌ๋ช…, 00์€ ์™„์ „ํžˆ ํˆฌ๋ช…์ž…๋‹ˆ๋‹ค. RGB๋Š” ์ฑ„๋„์„ ์‹ญ์ง„์ˆ˜ ์„ธ ์Œ์œผ๋กœ ํ’€์–ด ์”๋‹ˆ๋‹ค. rgb(r, g, b)์—์„œ๋„ ๊ฐ ๊ฐ’์€ 0–255 ๋ฒ”์œ„์ž…๋‹ˆ๋‹ค. HSL์€ ๋‹ค๋ฅธ ์ ‘๊ทผ์„ ์”๋‹ˆ๋‹ค. hsl(h, s%, l%)์€ ์ƒ‰์ƒ(hue)์„ ์ƒ‰์ƒํ™˜์„ ๋„๋Š” ๊ฐ๋„(0–360°, 0์€ ๋นจ๊ฐ•, 120์€ ์ดˆ๋ก, 240์€ ํŒŒ๋ž‘)๋กœ, ์ฑ„๋„(saturation)์™€ ๋ช…๋„(lightness)๋Š” ๋ฐฑ๋ถ„์œจ๋กœ ํ‘œํ˜„ํ•ฉ๋‹ˆ๋‹ค.

๋ณ€ํ™˜์€ ์ˆœ์ˆ˜ ์‚ฐ์ˆ ์ž…๋‹ˆ๋‹ค. HEX→RGB๋กœ ๊ฐ€๋ ค๋ฉด ๋ฌธ์ž์—ด์„ ์„ธ ์Œ์œผ๋กœ ๋‚˜๋ˆ  ๊ฐ๊ฐ์„ 16์ง„์ˆ˜๋กœ ์ฝ์Šต๋‹ˆ๋‹ค. RGB→HSL๋กœ ๊ฐ€๋ ค๋ฉด ๊ฐ ์ฑ„๋„์„ 0–1๋กœ ์ •๊ทœํ™”ํ•œ ๋’ค ์ตœ๋Œ“๊ฐ’๊ณผ ์ตœ์†Ÿ๊ฐ’์œผ๋กœ ๋ช…๋„๋ฅผ ๊ตฌํ•˜๊ณ , ๊ทธ ์ฐจ์ด๋กœ ์ฑ„๋„๋ฅผ ๋„์ถœํ•œ ๋‹ค์Œ ์–ด๋А ์ฑ„๋„์ด ์ •์ ์ธ์ง€๋กœ ์ƒ‰์ƒ(hue)์„ ๊ตฌํ•ฉ๋‹ˆ๋‹ค. ๋‘ ๊ฐ€์ง€ ์‹ค๋ฌด์  ์ฃผ์˜์ ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ๋ชจ๋‹ˆํ„ฐ๋งˆ๋‹ค ๋‹ฌ๋ผ์„œ ๊ฐ™์€ ์ˆซ์ž๋ผ๋„ ํ•˜๋“œ์›จ์–ด์— ๋”ฐ๋ผ ์•ฝ๊ฐ„์”ฉ ๋‹ค๋ฅด๊ฒŒ ๋ Œ๋”๋ง๋ฉ๋‹ˆ๋‹ค(๊ฐ๋งˆ์™€ ์ƒ‰ ๊ด€๋ฆฌ๊ฐ€ ์ ์šฉ๋จ). ๊ทธ๋ฆฌ๊ณ  ์•ŒํŒŒ ์ฑ„๋„์„ ํ•จ๊ป˜ ์“ธ ๋•Œ๋Š” ์š”์†Œ ๋’ค์— ๋†“์ธ ๊ฒƒ๊นŒ์ง€ ํ•จ๊ป˜ ๊ณ ๋ คํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค — ์•ŒํŒŒ๋Š” ๋ฐฐ๊ฒฝ๊ณผ ํ˜ผํ•ฉ๋˜๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

์ž์ฃผ ์“ฐ๋Š” ๊ฒฝ์šฐ

  • ๋””์ž์ด๋„ˆ์˜ HEX ํ† ํฐ์„ hsl()๋กœ ์˜ฎ๊ฒจ hoverยท๋น„ํ™œ์„ฑ ์ƒํƒœ๋ฅผ ๋„์ถœํ•˜๊ธฐ
  • DevTools์—์„œ rgb() ๊ฐ’์„ ์ฝ์–ด Sass๋‚˜ CSS ๋ณ€์ˆ˜์— ๋ถ™์—ฌ๋„ฃ๊ธฐ
  • ๋ธŒ๋žœ๋“œ ๊ฐ•์กฐ์ƒ‰์„ ๊ณ ๋ฅด๊ณ  ๋ฐ˜ํˆฌ๋ช… ์˜ค๋ฒ„๋ ˆ์ด์šฉ 8์ž๋ฆฌ #RRGGBBAA ํ˜•ํƒœ ๊ฐ€์ ธ์˜ค๊ธฐ
  • HSL ๋ช…๋„๋ฅผ ์กฐ์ •ํ•ด ์˜ˆ์ธก ๊ฐ€๋Šฅํ•œ ๋ช…์•”๋น„๋กœ ์ ‘๊ทผ์„ฑ ํŒ”๋ ˆํŠธ ๋งŒ๋“ค๊ธฐ

์‚ฌ์šฉ ์˜ˆ

์ธ๋””๊ณ ์ƒ‰ #4f46e5๋ฅผ ์˜ˆ๋กœ ๋“ค๋ฉด, 4f, 46, e5 ์Œ์œผ๋กœ ๋‚˜๋ˆ  ๊ฐ๊ฐ์„ 16์ง„์ˆ˜์—์„œ ๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค:

0x4f = 79
0x46 = 70
0xe5 = 229
#4f46e5  =  rgb(79, 70, 229)

์ด ์ฑ„๋„๋“ค์„ ์ •๊ทœํ™”ํ•˜๊ณ  HSL ๊ณต์‹์„ ์ ์šฉํ•˜๋ฉด:

#4f46e5  =  hsl(244, 76%, 59%)

๊ฐ™์€ ์ƒ‰, ์„ธ ๊ฐ€์ง€ ํ‘œ๊ธฐ๋ฒ• — ํ™”๋ฉด ํ”ฝ์…€์€ ๋™์ผํ•˜์ง€๋งŒ ์ฝ”๋“œ๋ฅผ ์ฝ๋Š” ์‚ฌ๋žŒ์—๊ฒŒ๋Š” ๋‹ค๋ฅธ ์‚ฌ์šฉ์„ฑ์„ ์ค๋‹ˆ๋‹ค.

์ž์ฃผ ๋ฌป๋Š” ์งˆ๋ฌธ

HEX, RGB, HSL์˜ ์ฐจ์ด๋Š”?

HEX๋Š” ๊ฐ ์ฑ„๋„์„ 16์ง„์ˆ˜ ๋‘ ์ž๋ฆฌ๋กœ ์••์ถ•ํ•ฉ๋‹ˆ๋‹ค(#RRGGBB). RGB๋Š” ๊ฐ™์€ ์„ธ ์ฑ„๋„์„ 0~255์˜ ์‹ญ์ง„์ˆ˜๋กœ ๋‚˜์—ดํ•ฉ๋‹ˆ๋‹ค. HSL์€ ์ƒ‰์„ ์ƒ‰์ƒํ™˜ ์œ„์˜ ๊ฐ๋„์ธ ์ƒ‰์ƒ(hue, 0~360๋„)๊ณผ ์ฑ„๋„, ๋ช…๋„(๋ฐฑ๋ถ„์œจ)๋กœ ํ‘œํ˜„ํ•ฉ๋‹ˆ๋‹ค. ์…‹ ๋ชจ๋‘ ๋™์ผํ•œ sRGB ์ƒ‰์„ ๋‹จ์ง€ ๋‹ค๋ฅธ ์ขŒํ‘œ๊ณ„๋กœ ์„œ์ˆ ํ•  ๋ฟ์ž…๋‹ˆ๋‹ค.

8์ž๋ฆฌ HEX ์ฝ”๋“œ๋Š” ๋ฌด์—‡์„ ํฌํ•จํ•˜๋‚˜์š”?

#RRGGBBAA ๊ฐ™์€ 8์ž๋ฆฌ HEX๋Š” ๋งˆ์ง€๋ง‰ 16์ง„์ˆ˜ ๋‘ ์ž๋ฆฌ์— ์•ŒํŒŒ ์ฑ„๋„์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. FF๋Š” ์™„์ „ ๋ถˆํˆฌ๋ช…, 00์€ ์™„์ „ ํˆฌ๋ช…์ž…๋‹ˆ๋‹ค. CSS Color 4์—์„œ ์ง€์›๋˜๋ฉฐ, ๋ณ„๋„์˜ opacity ์†์„ฑ ์—†์ด ๋ถˆํˆฌ๋ช…๋„๋ฅผ ์ธ์ฝ”๋”ฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

HEX๋ฅผ RGB๋กœ ์–ด๋–ป๊ฒŒ ๋ณ€ํ™˜ํ•˜๋‚˜์š”?

6์ž๋ฆฌ HEX๋ฅผ ์„ธ ์Œ์œผ๋กœ ๋‚˜๋ˆ„๊ณ  ๊ฐ ์Œ์„ 16์ง„์ˆ˜๋กœ ์ฝ์Šต๋‹ˆ๋‹ค. #4f46e5์˜ ์Œ์€ 4f, 46, e5์ด๋ฉฐ, ์ด๋Š” ๊ฐ๊ฐ 79, 70, 229๊ฐ€ ๋˜์–ด rgb(79, 70, 229)๊ฐ€ ๋ฉ๋‹ˆ๋‹ค.

์ƒ‰ ์กฐ์ •์— HSL์ด RGB๋ณด๋‹ค ๋‚˜์€๊ฐ€์š”?

์‚ฌ๋žŒ์ด ์ง์ ‘ ์กฐ์ •ํ•  ๋•Œ๋Š” ๊ทธ๋ ‡์Šต๋‹ˆ๋‹ค. HSL์€ ์ง€๊ฐ๋˜๋Š” ์ƒ‰์ƒ(hue)์„ ์ฑ„๋„ยท๋ช…๋„์™€ ๋ถ„๋ฆฌํ•˜๋ฏ€๋กœ ์ƒ‰์„ ์˜ˆ์ธก ๊ฐ€๋Šฅํ•˜๊ฒŒ ์–ด๋‘ก๊ฒŒ ํ•˜๊ฑฐ๋‚˜ ์ฑ„๋„๋ฅผ ๋‚ฎ์ถœ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. RGB๋Š” ์„œ๋กœ ์ƒ๊ด€๋œ ์„ธ ์ฑ„๋„์˜ ๊ท ํ˜•์„ ๋งž์ถฐ์•ผ ํ•ด์„œ ๋‹ค๋ฃจ๊ธฐ๊ฐ€ ๋” ์–ด๋ ต์Šต๋‹ˆ๋‹ค.

๋ณ€ํ™˜๋œ ์ƒ‰์ด ์„œ๋ฒ„๋กœ ์ „์†ก๋˜๋‚˜์š”?

์•„๋‹™๋‹ˆ๋‹ค. ๋ชจ๋“  ๋ณ€ํ™˜์€ ๋ธŒ๋ผ์šฐ์ €์—์„œ ์ฑ„๋„ ๊ฐ’์— ๋Œ€ํ•œ ์ˆœ์ˆ˜ JavaScript ์‚ฐ์ˆ ๋กœ ์ด๋ฃจ์–ด์ง‘๋‹ˆ๋‹ค. ์—…๋กœ๋“œ๋˜๋Š” ๊ฒƒ์€ ์—†์œผ๋ฏ€๋กœ ๋ธŒ๋žœ๋“œ ํŒ”๋ ˆํŠธ๋‚˜ ์‚ฌ๋‚ด ๋””์ž์ธ ํ† ํฐ๊ณผ ํ•จ๊ป˜ ์จ๋„ ์•ˆ์ „ํ•ฉ๋‹ˆ๋‹ค.