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

  1. Paste or type a color code into the box — it converts as you type.
  2. Check the “Read as” line to confirm which notation was recognised.
  3. Drag the alpha slider if you need a translucent variant.
  4. 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

All how-to guides →

All image tools →