Calculator

Colour Converter: HEX, RGB, HSL, CMYK and Lab

Enter a colour value and get it instantly in all common notations: HEX, RGB, HSL, HSV, CMYK, CIE Lab and LCH. The converter also shows the nearest CSS colour name, the difference to a second colour and whether the contrast between the two is sufficient for text. Everything runs in your browser.

Enter a colour value, e.g. #C02318, 192, 35, 24 or hsl(4, 78%, 42%).

    Compare with a second colour

    Which inputs the converter understands

    The input field recognises several notations and picks the right one by itself. A hex value works with or without the hash sign and in short form: #C02318, C02318 and #C21 are all valid. For RGB, three numbers from 0 to 255 are enough, separated by a comma, semicolon or space, or the full form rgb(192, 35, 24). HSL uses the form hsl(4, 78%, 42%), and you can also type CSS colour names such as tomato or steelblue. If you prefer picking over typing, use the colour picker next to the field; the picker and the text field stay in sync.

    The colour models at a glance

    The same colour can be described in several ways, and which model is most practical depends on the task. The overview below shows what each notation is typically used for.

    • HEX and RGB describe how much red, green and blue a screen mixes. These are the notations for websites, presentations and most graphics and CAD programs.
    • HSL and HSV arrange the same colour by hue, saturation and lightness. This helps when a colour should become “a bit lighter” or “less intense” without adjusting three RGB values at once.
    • CMYK is the language of four-colour printing with cyan, magenta, yellow and black. The converter gives a simple mathematical approximation without a colour profile (see below).
    • CIE Lab and LCH are perception-oriented: equal numerical distances correspond roughly to equal differences in visual impression. That is why Lab is suited to comparisons and distance calculations.

    Colour difference and contrast

    When a second colour is entered below, the converter calculates two figures. The colour difference ΔE (here CIE76, i.e. the distance in Lab space) says how different two colours look. As a rough rule of thumb, differences below about 1 are practically invisible, up to about 2 visible only on close comparison, and from about 10 clearly different. How strictly a difference should be judged depends on the application; for production tolerances, the requirements of the respective order apply.

    The contrast ratio follows the calculation of the Web Content Accessibility Guidelines (WCAG). For normal text, 4.5:1 is the minimum (level AA) and 7:1 the enhanced requirement (level AAA); for large text, 3:1 is enough. This helps with drawings, labels and slides where text on a coloured background must stay readable.

    What the converter deliberately does not do

    The converter translates between mathematically defined colour models. It replaces neither a colour fan deck nor colour management. Three points matter:

    • Screen is not material. A hex value describes a screen colour (sRGB). How a painted surface, a plaster or a powder coating looks in daylight depends on the material, the gloss level and the lighting. For binding colours, the sample on the object remains authoritative.
    • CMYK is an approximation here. The conversion is made without a print profile. For print data, the conversion belongs in the printer’s colour profile, otherwise hue and saturation will deviate.
    • Licensed colour systems are not included. Collections such as RAL, NCS or Pantone are protected systems of their respective publishers. Their colour values and designations are neither stored here nor converted. For a binding match, the official fan decks or licensed products of the publisher apply.

    Typical uses

    • Transfer a colour value from a drawing, a presentation or a CAD program into the notation of another software.
    • Check whether two colours in a legend, a label or a drawing remain sufficiently distinguishable.
    • Assess the readability of text on a coloured background, for example in a title block or on slides.
    • Convert a colour for a website or document from hex to HSL and darken or lighten it deliberately.
    • Find the nearest named CSS colour as a point of reference.

    Everything stays on your device

    The colour converter runs entirely in your browser. Entered colour values are neither sent to a server nor stored; when you close the tab, they are gone. This is the same approach as in the PDF Compare tool, the Slope Calculator and the Sketch tool. How this is meant is explained in more detail under Methodology.