HTML Colour Picker — Hex, RGB, HSL, RGBA, HSLA & Hex8

Pick a colour, tweak opacity, convert formats, and check accessibility. 100% client-side.

Colour & Formats

Recents & Favourites

Preview & Contrast

Preview on Light

The quick brown fox

Preview on Dark

The quick brown fox

Preset Palette

Understanding Colour Formats (Hex, RGB, HSL, RGBA, HSLA, Hex8)

Designers and developers reach for different colour formats depending on the job. This picker shows and converts Hex, RGB, and HSL — and, with the alpha slider, it also outputs RGBA, HSLA, and Hex8 (hex with transparency). You can paste any of these into CSS or design tools and copy values with one click.

Hexadecimal (Hex / Hex8)

  • Format: #RRGGBB (e.g., #1E90FF) or shorthand #RGB. With alpha, Hex8 becomes #RRGGBBAA (e.g., #1E90FFCC).
  • Use it for: CSS colours, design tokens, styleguides, favicons, quick copy/paste.
  • When to prefer Hex8: You need a single string that also encodes transparency.

RGB / RGBA

  • Format: rgb(30, 144, 255) and rgba(30, 144, 255, 0.8).
  • Use it for: Scripted colour manipulation, canvas work, and when opacity is adjusted in code.

HSL / HSLA

  • Format: hsl(210, 100%, 56%) and hsla(210, 100%, 56%, 0.8).
  • Use it for: Theming and palettes — it’s easy to make tints/shades by changing lightness, or reduce intensity by lowering saturation.

Accessibility & Contrast

The built-in contrast checker computes WCAG contrast ratios of your colour against light and dark backgrounds (and an optional custom background). Look for AA and AAA badges to verify text meets accessibility guidelines.

Productivity Features

  • Eyedropper: Pick any pixel colour from your screen (supported browsers).
  • Alpha slider: Instantly see RGBA, HSLA, and Hex8 outputs.
  • Recents & Favourites: Your last colours and saved swatches persist in this browser.
  • Permalinks: Share the exact colour + opacity using the URL hash.
  • Copy bundles: One click to copy CSS variables or handy Tailwind snippets.

5 Fun Facts about Web Colours

Hex is camera film math

#RRGGBB mirrors 8-bit channels from early bitmap displays—256 levels per channel, 16.7 million combos from 3 bytes.

Origins

140 named colours are built-in

CSS supports 140 legacy names like rebeccapurple and lightgoldenrodyellow. They’re case-insensitive and map to fixed Hex values.

CSS trivia

Hex8 hides alpha in plain sight

#RRGGBBAA stores transparency as the last two hex digits. CC equals about 80% opacity; 80 is ~50%.

Opacity math

HSL is hue on a 0–360 wheel

Hue numbers wrap around a colour wheel: 0 and 360 are red, 120 green, 240 blue. Lightness 50% sits in the middle.

Hue map

Contrast ratios are logarithmic

WCAG contrast uses relative luminance; 4.5:1 is AA for body text, 3:1 for large text. Doubling contrast isn’t a simple brightness tweak—it’s a math ratio.

Accessibility

Explore more tools