Color Code Converter
Convert color codes between HEX, RGB, HSL, HSV, HWB, CMYK, LAB, LCH, OKLab, OKLCH, XYZ and CSS names. Paste any notation, copy any format. Free, no signup.
Loading the tool…
Free Color Code Converter — All Formats
Convert a color between every notation in use on the web, in print and in app code. Paste HEX, RGB, HSL, HSV/HSB, HWB, CMYK, CIE LAB, LCH, OKLab, OKLCH, CIE XYZ, a CSS color name, a 0x literal or a decimal integer, and every other format is produced at once. The converter runs entirely in your browser — nothing is sent to a server.
Formats it reads
Hex in 3, 4, 6 and 8 digits (#39f, #3b82f6, #3b82f6cc); both the legacy comma syntax and the modern space syntax with a slashed alpha (rgb(59 130 246 / 50%)); hue in deg, rad, grad or turn; percentages or plain numbers for channels; all 148 CSS named colors including rebeccapurple; and the transparent keyword.
Formats it writes
- CSS & web — HEX, short HEX, 8-digit HEX with alpha, RGB, RGBA, modern RGB, HSL, HSLA, HWB, and the CSS color name when there is an exact one.
- Perceptual & print — HSV/HSB, CMYK, CIE LAB, CIE LCH, OKLab, OKLCH and CIE XYZ.
- Numeric — decimal integer, hex literal, Android ARGB, percentage RGB and normalised 0–1 RGB.
- Code — CSS custom property, Tailwind arbitrary value and nearest Tailwind class, SwiftUI, UIKit, Android/Kotlin, Flutter, .NET, Java AWT, a Python tuple and a GLSL
vec4.
How to Use
- Paste or type a color code into the box — it converts as you type.
- Check the “Read as” line to confirm which notation was recognised.
- Drag the alpha slider if you need a translucent variant.
- Click any row to copy that single value, or use Copy all or JSON to take everything.
Notes on accuracy
LAB, LCH and XYZ use a D65 white point, matching CSS. LAB, LCH, OKLab and OKLCH can describe colors that no sRGB screen can display; when you enter one, it is clipped into sRGB and the tool tells you so. CMYK is a naive device conversion, not an ICC-managed one — use your print provider's profile for production work. A bare string of 3 or 6 hex characters is read as hex even when it is all digits, so the unambiguous way to enter a decimal is dec(255).
Privacy and Security
We respect your privacy. This tool is a browser-based application, so every conversion happens on your own device. Nothing you enter is uploaded to our servers or stored.
Guides
- How to Convert HEX to RGB (and Any Colour Format)Convert a HEX colour code to RGB, HSL, CMYK, OKLCH or code for Swift, Android and Flutter instantly — plus how the conversion works by hand.
- How to Change the Colours of an Image (Hue Shift)Shift every colour in an image around the colour wheel to recolour a logo, icon or product variant, and raise or lower saturation. Free, in your browser.
- How to Find the Colour Code of Anything in a PhotoPick the exact colour from a photo, logo or screenshot and get its HEX, RGB, HSL and CMYK codes — with a pixel loupe, averaging for photos and contrast checks.
- How to Make a Colour Palette from a PhotoExtract the dominant colours from any photo to build a palette for a brand, website, room or artwork — with HEX codes, and tips for turning it into a scheme.
Related tools
- Image Color PickerPick colors from any photo with a pixel loupe and Photoshop-style sample averaging. Get HEX, RGB, HSL, HSV, CMYK, LAB and OKLCH, plus WCAG contrast checks and the nearest Tailwind class.
- Color Palette GeneratorExtract a color palette of dominant colors from any image. Great for design inspiration and branding.
- Paint Color Mixing CalculatorWork out what colour paints make when mixed, and how much of each to measure. Subtractive RYB mixing — yellow + blue really makes green — plus a reverse solver that gives you a recipe in whole parts.
- Hair Dye Mixing CalculatorEnter your colour-to-developer ratio plus a total, the dye you have, or your hair length — get the exact amount of each, how many tubes to buy and what’s left over.
- AI Image Generator & EditorGenerate images from a text prompt with AI, or upload your own — then crop, filter, and refine with AI edits. Free.
- AI Photo EnhancerEnhance and upscale any photo with AI — sharpen detail, fix lighting and colour, reduce noise. Modes: Beta, Enhancer, Enhancer Pro. Free, 2 photos per day.

