Color Code

Color Code Converter (HEX, RGB, HSL, CMYK)

Type a color code in any format, or pick a color, to convert it to HEX, RGB, HSL, HSV and CMYK at once. You can also paste CSS such as rgb(…), hsl(…) or a color name like “tomato”.

#ffd400

Text on this color

Sample text AaWhite text Easier to read
Sample text AaBlack text Easier to read
Relative luminance
Brightness
Check contrast in detail →

Nearest CSS color names

    Lighter and darker

    Copy CSS

      • CMYK is calculated with a simple formula. Printed colors depend on paper, ink and color profiles, so check with your printer for print work.
      • The contrast ratio follows WCAG 2.x. 4.5:1 or more is recommended for body text. Use the color contrast checker for details.
      • Transparency (alpha) is not supported. Everything runs in your browser.

      About this tool

      Convert color codes between HEX, RGB, HSL, HSV and CMYK for free. Type in any field and the others update instantly, or pick a color with the color picker. The tool also shows the nearest CSS color names, whether white or black text is easier to read on the color, lighter and darker shades, and ready-to-copy CSS. Everything is calculated in your browser.

      How to use

      1. Use “Pick a color”, or paste a color such as #ffd400, rgb(255 212 0) or tomato.
      2. See the results in the HEX, RGB, HSL, HSV / HSB and CMYK fields. Editing any field updates the others.
      3. Check “Text on this color” to see whether white or black text reads better, and “Nearest CSS color names” for similar named colors.
      4. Under “Copy CSS”, click “Copy” next to the format you need.

      Useful for

      • Turning a HEX code from a design into CSS rgb() or hsl()
      • Getting approximate CMYK values for a logo color
      • Deciding between white and black text on a button or banner
      • Creating lighter and darker shades of a brand color

      FAQ

      How do I convert HEX to RGB?

      Each pair of HEX digits is a hexadecimal number from 00 to ff, which becomes 0–255 in RGB (for example #ffd400 becomes 255, 212, 0). Just type the HEX code here to convert it.

      Can I use the CMYK values for printing?

      They are estimates from a simple formula. Printed colors depend on paper, ink and color profiles, so check with your printer.

      What is the difference between HSL and HSV?

      Both describe hue and saturation. In HSL, 50% lightness is the most vivid and 100% is white; in HSV, 100% value is the most vivid. CSS uses HSL.

      Does it support transparency (alpha)?

      No. For rgba() or 8-digit HEX, enter only the color part.

      Need a color scheme for your brand?

      We design websites with colors that fit your brand and stay readable for everyone.

      Ask about web design
      Contact