Color Converter

Convert colors between HEX, RGB, and HSL formats. Includes live color preview.

Free Runs in your browser

How to use

  1. 1 Enter a color value in any format: HEX (#ff6b35), RGB (255, 107, 53), or HSL (20, 100%, 60%).
  2. 2 All other formats update instantly as you type with no button required.
  3. 3 Click the color swatch at the bottom to open the native color picker and choose a color visually.
  4. 4 Select and copy any output field to use the value in your CSS or design tool.

Key features

  • Real-time bidirectional conversion between HEX, RGB, and HSL
  • Native color picker for visual color selection
  • Live color swatch updates as you type
  • Useful for converting design tool colors to CSS-ready formats

HEX, RGB, and HSL: When to Use Which

CSS accepts the same color in multiple formats. They're all interchangeable in browsers; the difference is purely about readability and workflow. HEX is the most compact; RGB is the most explicit; HSL is the most intuitive for humans because it separates hue, saturation, and lightness in a way that mirrors how we think about color.

Modern CSS also supports oklch() and oklch(), which offer better perceptual uniformity, but HEX, RGB, and HSL remain the formats used by virtually every design tool, design system, and developer today.

Common Use Cases

Design system token conversion

Convert brand colors from a designer's HEX values to the HSL format required by your CSS custom properties.

Building light and dark themes

Convert colors to HSL to generate lighter or darker variants by adjusting the L (lightness) value.

Cross-tool consistency

Match a Figma HEX color to a Tailwind CSS HEX, or verify an RGB value from a color picker.

CSS variable definitions

Define CSS custom properties in HSL format so you can compose color variants programmatically.

Email template colors

Some email clients require hex; others support rgb(). Convert to whichever works for your context.

Verifying color output

Check that a programmatically generated color (from a chart library or canvas) matches the intended brand color.

Format Comparison

FormatExampleBest for
HEX#3b82f6Design tools, brand colors, Tailwind config
RGBrgb(59, 130, 246)CSS variables with alpha channel, canvas drawing
RGBArgba(59, 130, 246, 0.5)Semi-transparent overlays, shadows
HSLhsl(217, 91%, 60%)Generating color scales, theming, light/dark modes