Skip to content

Color Converter & Picker

Convert colours between HEX, HEXA, RGB, RGBA, HSL, HSLA, HSV, HSVA and CSS named colours. Pick a colour, adjust alpha, preview it on light and dark backgrounds and see its contrast ratio against white and black.

Developer Runs client-side Free to use
Jump to the tool
Share: X WhatsApp
Loading Color Converter & Picker…

About the Color Converter & Picker

Color Converter & Picker converts one colour into every common format at once: HEX and HEXA, rgb() and rgba(), hsl() and hsla(), HSV and HSVA, and the matching CSS named colour when one exists. You can type a value in any of these formats, use your browser’s colour picker, or edit the red/green/blue, hue/saturation/lightness or hue/saturation/value numbers directly. An alpha slider and number control transparency, and every output updates instantly.

A live preview shows the colour on a light and a dark background and as a background behind white or black text, which you can choose yourself or leave on automatic. The tool calculates the contrast ratio of the colour against pure white and pure black using the WCAG 2 relative-luminance formula. This is a calculated ratio for one colour pair; it does not show that a complete interface meets WCAG. Values outside their allowed ranges are rejected with a clear message rather than silently clamped. HSV is not a CSS function, so it is offered for design apps only.

How to use

  1. Type a colour (for example #2563eb, rgba(37, 99, 235, 0.5) or rebeccapurple) or choose one with the colour picker.
  2. Fine-tune it with the RGB, HSL or HSV number fields and the alpha slider.
  3. Check the light and dark previews and choose white, black or automatic preview text.
  4. Read the contrast ratios against white and black.
  5. Copy any single format, copy all formats, or download them as a .txt or .css file.

Key features

  • Reads HEX (3, 4, 6 or 8 digits), rgb()/rgba(), hsl()/hsla(), hsv()/hsva() and CSS named colours.
  • Browser-native colour picker plus editable RGB, HSL, HSV and alpha fields.
  • Live preview on light and dark backgrounds, with selectable preview text colour.
  • Contrast ratio against white and black, with reference thresholds.
  • Copy each value individually or all formats at once.
  • Download a .txt summary or a .css file of custom properties.

Best practices

  • Use HEXA or rgba() when you need transparency in CSS; plain HEX is always opaque.
  • Check contrast with the real foreground and background colours of your design, not only against white and black.
  • Remember that transparent colours change with whatever is behind them.
  • Store design tokens in one format (such as HEX or HSL) and convert only where needed.
  • Test colours on real screens and in both light and dark themes.

Benefits

  • One place to translate colours between design tools and CSS.
  • Catch out-of-range or malformed values before they reach your stylesheet.
  • Quick contrast sanity checks while choosing colours.
  • Runs entirely in your browser with no sign-up.

Frequently asked questions

Which input formats are accepted?

HEX with 3, 4, 6 or 8 digits after #, rgb() and rgba() with numbers or percentages, hsl() and hsla(), hsv() and hsva(), and the 148 CSS named colours (plus transparent) that your browser supports. Both comma and space-separated syntax work, for example rgb(37, 99, 235) or rgb(37 99 235 / 0.5).

Why is my value rejected instead of corrected?

Out-of-range values, such as rgb(300, 0, 0) or hsl(200, 120%, 50%), are reported as errors so that mistakes are not hidden. Browsers clamp such values in CSS, which can make a typo hard to notice.

How is the contrast ratio calculated?

It uses the WCAG 2 relative-luminance formula for the colour at full opacity, compared with pure white and pure black. The result is a calculated ratio for that pair only; it does not prove that a page or app meets WCAG or any other accessibility standard.

Why might converted values differ slightly after a round trip?

HEX and RGB use whole numbers from 0 to 255, while HSL and HSV are shown to one decimal place. Rounding means converting back and forth can shift a value by a small fraction.

Is HSV valid in CSS?

No. CSS supports HEX, rgb(), hsl() and several newer functions, but not hsv(). HSV (also called HSB) is common in design tools, so it is provided for those, and the .css download includes it only as a comment.

Does the colour picker support transparency?

The browser’s native colour picker selects opaque colours only. Use the alpha slider or number field to set transparency, or type a HEXA, rgba(), hsla() or hsva() value.

Is anything uploaded or saved?

No. All conversions run in your browser and nothing is stored.