03 · Converter
Color converter, every notation, both directions.
All models
Edit any channel: everything stays in syncHEX
Hexadecimal
#845EC2
RGB
R
G
B
α
rgb(132, 94, 194)
HSL
H°
S%
L%
hsl(263, 45%, 57%)
HSV
H°
S%
V%
hsv(263, 52%, 76%)
CMYK
C%
M%
Y%
K%
cmyk(32%, 52%, 0%, 24%)
OKLCH
L
C
H°
oklch(0.567 0.152 299)
Guide
How to convert HEX to RGB (and back)
Hexadecimal color is just base-16 notation for the red, green and blue channels. The code #845EC2 splits into three pairs: 84 for red, 5E for green and C2 for blue. Convert each pair to decimal — 84 becomes 132, 5E becomes 94 and C2 becomes 194 — and you have rgb(132, 94, 194). Shorthand hex like #abc expands to #aabbcc before the same conversion.
Going the other way divides each channel by 16 and writes the quotient and remainder as hex digits: 132 is 8×16 + 4, so it becomes 84, and values below 16 need a leading zero. This converter does that two-way math live for every field — type in any format and all six models update together, so you never lose the value you started with.
Which color format should I use?
HEX is the compact standard for CSS, design tools and anywhere a color travels as a short string. RGB mirrors how screens emit light and is the right choice when you need alpha transparency as rgba(). HSL — hue, saturation, lightness — is the most intuitive model for editing: keep the hue, move one slider to generate tints and shades systematically.
HSV works similarly for pickers, CMYK describes subtractive ink for print (conversions from sRGB are approximations, not color-managed proofs), and OKLCH is the perceptually uniform next generation built into modern CSS: equal lightness steps look equally light, which makes palettes far easier to balance. Every conversion on this page is computed locally with full precision.
Frequently asked questions
- How do I convert hex to RGB?
- Split the six-digit hex code into three pairs, then convert each pair from base 16 to decimal. #845EC2 = 84₁₆, 5E₁₆, C2₁₆ = 132, 94, 194, so the RGB value is rgb(132, 94, 194). Type either value into this converter to get the other instantly.
- What is #845EC2 in RGB and HSL?
- #845EC2 converts to rgb(132, 94, 194) and hsl(263, 44%, 56%). It is the Swatchboard brand purple — a mid-lightness violet that works well as a base color for palette generation.
- What is the difference between HSL and OKLCH?
- HSL is based on the HSV hue circle and compresses lightness unevenly across hues, so 50% lightness yellow looks much brighter than 50% lightness blue. OKLCH is perceptually uniform: its lightness axis matches what the eye sees, producing balanced ramps, though its wider gamut can clip colors outside sRGB.