Home › Design Tools › Colour Converter

Colour Converter

Enter a colour in any supported format and see it in HEX, RGB, HSL and HSV. Copy any value with its button. Everything runs in your browser.

Accepts #f80, #ff8800, #ff880080, rgb(255, 136, 0), rgba(255, 136, 0, 0.5), hsl(32, 100%, 50%) and hsv(32, 100%, 100%).

Enter a colour.
FormatValueCopy
HEX-
RGB-
HSL-
HSV-
Nothing you type is sent anywhere or stored.

How to use

  1. Type or paste a colour into the Colour box. The page accepts HEX (3, 4, 6 or 8 digits, with or without #), rgb(), rgba(), hsl(), hsla() and hsv().
  2. The table updates as you type. If the text cannot be read, the result line says what to change.
  3. Press the Copy button on the row you want. Only that format is copied.
  4. To go the other way, paste any value from the table back into the box.

Worked example

Take the orange #f80. The three-digit form doubles each digit, so it is #ff8800. The converter gives:

FormatValue
HEX#FF8800
RGBrgb(255, 136, 0)
HSLhsl(32, 100%, 50%)
HSVhsv(32, 100%, 100%)

A less tidy colour shows the rounding. Forest green, rgb(34, 139, 34), becomes hsl(120, 60.7%, 33.9%) and hsv(120, 75.5%, 54.5%). With alpha, #3366cc80 becomes rgba(51, 102, 204, 0.5), because the alpha byte 0x80 is 128, and 128 / 255 is about 0.50, shown as 0.5.

How it works

The page reads your colour with one script, colour.js, which works out every format from the same whole RGB values. Nothing is sent to a server and nothing is saved.

The colour models. RGB mixes red, green and blue light, each from 0 to 255. HSL describes the same colour as a hue angle (0 to 360 degrees round the colour wheel), a saturation and a lightness. HSV, also called HSB, uses hue, saturation and value (brightness). HSL and the HEX and RGB notations are defined in CSS Color Module Level 4. HSV is not a CSS function, so browsers will not accept hsv() in a stylesheet. Convert it to HSL, RGB or HEX first.

Rounding. RGB channels are whole numbers from 0 to 255. A value that falls exactly halfway is rounded up. Hue is shown to 1 decimal place in degrees, and a hue that rounds to 360 is shown as 0. Saturation, lightness and value are shown to 1 decimal place as percentages. Trailing zeros are dropped, so 50.0% is shown as 50%.

Alpha. A 4 or 8 digit HEX value, or an rgba or hsla value, carries an alpha channel from 0 to 1. A HEX alpha byte b gives alpha b / 255, shown to 2 decimal places. A typed alpha is turned into a HEX byte as alpha x 255, rounded half up.

Accepted input. HEX takes 3, 4, 6 or 8 digits. RGB takes three whole numbers from 0 to 255. HSL and HSV take a hue from 0 to 360 degrees and saturation, lightness or value from 0% to 100%. Decimals are allowed. Anything else is refused with a message that says what to change.

Common mistakes

Frequently asked questions

Why is HEX shown in capitals?

It is a display choice. HEX is not case sensitive, so #ff8800 and #FF8800 are the same colour.

What is the difference between HSL and HSV?

In HSL, lightness 50% is the pure colour, and 100% is white. In HSV, value 100% is the brightest form of the colour, and white needs saturation 0%. Design tools often use HSV for their pickers, while CSS uses HSL.

Does the converter handle named colours like "tomato"?

No. It reads the formats listed above only. Look up the name's HEX value and paste that.

Is the colour the same on every screen?

The numbers are the same, but displays differ in calibration and colour range. Treat the conversion as exact and the appearance as approximate.

Do you store my colours?

No. Everything runs in your browser.

Related tools