Color tools

Convert any colour between HEX, RGB and HSL in real time — and copy the value you need in one click.

One colour, three ways to write it

A single on-screen colour can be written in several notations, and web work constantly moves between them. A designer hands you a #3B82F6 hex code from a style guide; the canvas API you are scripting wants raw rgb() channels; and to build a hover state you really want hsl() so you can nudge the lightness without touching the hue. This tool keeps all three notations in sync: edit any one field and the other two — plus the live swatch on the left — update the instant the value becomes valid.

Everything is the same colour underneath. HEX and RGB are just two ways of writing the amount of red, green and blue light a pixel emits (HEX in base-16 byte pairs, RGB in plain decimals 0–255). HSL re-describes that same point as a position on the colour wheel, so it reads the way humans think about colour rather than the way a screen produces it.

A worked example

Take #3B82F6. Splitting it into byte pairs gives 3B, 82 and F6, which in decimal are 59, 130 and 246 — so rgb(59, 130, 246). Running those channels through the HSL formula lands on hsl(217, 91%, 60%): a hue of 217° (a confident blue), high saturation, and a lightness just above the midpoint. Want the complementary colour for an accent? Add 180° to the hue to get hsl(37, 91%, 60%), a warm amber — same vividness, opposite side of the wheel.

When to reach for each format

FormatParametersRangeBest for
HEX #RRGGBB #000000 – #FFFFFF Style guides, CSS, branding — the most compact written form.
RGB Red, Green, Blue 0 – 255 each Canvas, image processing and fading individual channels in code.
HSL Hue, Saturation, Lightness 0–360° / 0–100% / 0–100% Tints, shades, hover states and generating harmonious palettes.

Building a palette from one hue

Because HSL isolates the hue, you can derive a whole scheme by rotating one number while keeping saturation and lightness fixed:

  • Complementary: add 180° for a high-contrast accent.
  • Analogous: shift ±30° for calm, cohesive neighbours.
  • Triadic: add 120° and 240° for a vivid, balanced trio.
Privacy note: there is no server behind this tool. Conversions, validation and the preview all run on your device with JavaScript, so any proprietary brand colours you paste stay entirely in this browser tab.

Frequently asked questions

Are my colours sent to a server?

No. Every conversion between HEX, RGB and HSL runs in your browser with plain JavaScript. Your brand colours, palette values and project assets are never uploaded, logged or stored anywhere.

Can I use shorthand HEX like #FFF?

Yes. Three-digit shorthand is expanded automatically — #FFF becomes #FFFFFF, and #3AF becomes #33AAFF. You can also paste a value with or without the leading # and the converter will normalise it.

Why do RGB and HSL sometimes round differently?

HSL is a different coordinate system from RGB, and the maths involves division that does not always land on whole numbers. Values are rounded to the nearest integer for display, so converting HEX to HSL and back can occasionally shift a channel by one. The preview always reflects the true colour.

What is the difference between RGB and HSL?

RGB describes a colour by how much red, green and blue light it mixes (0–255 each), which mirrors how a screen produces it. HSL describes the same colour by Hue (its position on the colour wheel), Saturation (how vivid it is) and Lightness (how bright it is), which is far more intuitive for designing tints, shades and palettes.

How do I build a colour scheme from one colour?

Convert your base colour to HSL, then rotate the Hue. Adding 180° gives the complementary colour, ±30° gives analogous colours, and +120°/+240° gives a triadic set. Because only the Hue changes, the colours stay balanced in saturation and lightness.