This is a tool to convert between RGB, HSV, and HSL color spaces, and the formula for the conversion.
Preview
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Background Color:
RGB (DEC/HEX)
Red
Green
Blue
HSV
Hue
Saturation
Value
HSL
Hue
Saturation
Lightness
How to use this tool
Input RGB, HEX, HSV, or HSL. The output will be automatically converted to each other.
HEX can also be entered as a 3-digit abbreviation. e.g. #3F9 → #33FF99
The background color of the preview can be changed in HEX.
Conversion between RGB and HSV/HSL is irreversible(*).
(*) Since the number of colors that can be represented is different between RGB and HSV/HSL, they are rounded off during conversion and cannot be accurately restored. RGB: 256 × 256 × 256 = 16,777,216 patterns HSV: 360 x 101 x 101 = 3,672,360 patterns
Color space conversion methods and formulas
RGB and HEX conversion (decimal to hexadecimal)
RGB represents each color in 256 steps from 0 to 255 (= 8 bits). Therefore, RGB is compatible with hexadecimal numbers, and software often uses hexadecimal numbers for representation.
In hexadecimal, colors are represented by adding # at the beginning, followed by 00 to FF (two hexadecimal digits) for red, green, and blue, in that order.
#FF9933 = rgb(255, 153, 51)
In addition, hexadecimal color codes can be specified as three-digit abbreviations in CSS and other formats.
#FF9933 = #F93
A total of six digits, two digits for each color, is abbreviated to three digits, one digit for each color, and can be used only when each digit is repeated twice.
RGB to HSV
The maximum value of R, G, and B is MAX, and the minimum value is MIN.
MAX=max{R,G,B}
MIN=min{R,G,B}
Hue
The formula changes depending on whether MAX is R, G, or B.