Color Picker

Pick colors and convert between HEX, RGB, and HSL online. Free color picker tool for web design and CSS.

Runs locally in your browser
HEX: #3b82f6
RGB: rgb(59, 130, 246)
HSL: hsl(217, 91%, 60%)

What is Color Picker?

A color picker lets you select colors visually and convert between HEX, RGB, RGBA, and HSL formats — the four representations web designers and developers use daily in CSS, design tools, and component libraries. HEX (#3b82f6) is compact and universal in design handoffs. RGB (rgb(59, 130, 246)) separates red, green, and blue channels for programmatic manipulation. HSL (hsl(217, 91%, 60%)) models hue, saturation, and lightness for intuitive color adjustments.

Modern web development requires fluency across all color formats. Design tools like Figma export HEX values. CSS preprocessors and JavaScript animation libraries manipulate RGB channels mathematically. Theme systems and dark mode implementations adjust HSL lightness while preserving hue. A single color like Format Hubs blue might appear as #2563eb in a style guide, rgb(37, 99, 235) in a canvas gradient, and hsl(221, 83%, 53%) in a hover state calculation.

Our color picker provides a visual spectrum selector, RGB and HSL sliders for fine control, and simultaneous display of all format values. Paste any supported format — HEX, rgb(), rgba(), hsl(), or CSS named colors like cornflowerblue — and all representations update instantly. Copy individual values or all formats at once for paste into CSS stylesheets, Tailwind config files, or design system documentation.

All conversion runs locally in your browser. Brand color palettes, proprietary design tokens, and client-specific theme values never upload to external servers. This matters when working with unreleased product designs, confidential brand guidelines, or client projects under NDA.

Colors often appear in CSS files, HTML templates, and JSON design token exports. Format related stylesheets with the CSS Minifier, prettify HTML with the HTML Prettier, and structure token JSON with the JSON Formatter. For comparing theme changes across versions, use the Diff Checker.

Frontend developers, UI/UX designers, design system maintainers, and brand managers use color pickers when building component libraries, creating CSS custom properties for theming, matching brand guidelines to web implementations, prototyping dark mode palettes, and converting design tool exports to production-ready CSS values.

When should you use Color Picker?

Convert HEX colors from Figma or Sketch designs to rgb() or hsl() values for CSS stylesheets and JavaScript animations.

Pick and fine-tune colors for CSS custom properties, Tailwind config extensions, and design system token files.

Parse rgba() values from existing stylesheets to adjust alpha transparency for overlays and glass-morphism effects.

Explore HSL adjustments for hover states, focus rings, and dark mode variants while preserving base hue.

How to Use Color Picker

  1. Pick a color with the visual picker or enter a value.
  2. Adjust RGB or HSL sliders for fine control.
  3. View HEX, RGB, and HSL values simultaneously.
  4. Copy all color values for use in CSS or design tools.

Features

  • Visual color picker with spectrum and brightness selection
  • Convert between HEX, RGB, RGBA, and HSL formats instantly
  • RGB and HSL sliders for precise channel adjustment
  • Parse pasted values: hex, rgb(), rgba(), hsl(), and named colors
  • Copy individual formats or all values at once
  • Live preview swatch of the selected color
  • 100% browser-based — color values stay private
  • Alpha channel support via RGBA parsing and output

Example

The HEX value #2563eb represents a blue with red channel 37 (0x25), green 99 (0x63), and blue 235 (0xeb) out of 255. In HSL, this translates to hue 221° (blue range), 83% saturation, and 53% lightness. Designers can lighten the color by increasing HSL lightness to 65% for a hover state without shifting the perceived hue.

HEX input

#2563eb

Converted formats

RGB: rgb(37, 99, 235) | HSL: hsl(221, 83%, 53%)

Common Errors

Missing hash prefix in HEX

CSS requires # before hex values; 2563eb without the hash is invalid and ignored by browsers.

Fix: Always include the # prefix: #2563eb. Three-digit shorthand (#fff) works for repeated pairs.

HSL versus HSB confusion

Photoshop and some design tools use HSB (brightness) while CSS uses HSL (lightness) — values differ for the same color.

Fix: Use this tool to convert between design tool exports and CSS; do not copy HSB values directly into hsl().

sRGB versus display P3

Wide-gamut displays render colors differently than sRGB values specify, causing design-to-code mismatches.

Fix: Use color(display-p3 ...) for wide-gamut targets; test on standard sRGB monitors for baseline accuracy.

Alpha channel in wrong format

HEX alpha (#rrggbbaa) is supported in modern browsers but rgba() has broader compatibility for transparency.

Fix: Use rgba(r, g, b, 0.5) for transparency when supporting older browsers; 8-digit HEX for modern-only.

Named color ambiguity

CSS named colors like 'gray' and 'grey' exist, but many names map to unexpected shades.

Fix: Prefer HEX or RGB for precise brand colors; use named colors only for prototyping and defaults.

Best Practices

  • Define brand colors once in CSS custom properties and reference them throughout your stylesheet
  • Use HSL for programmatic lightness adjustments in hover, focus, and dark mode variants
  • Store design tokens as HEX in JSON files and convert to CSS formats at build time
  • Test colors at WCAG AA contrast ratios (4.5:1 for text) against background colors
  • Copy rgba() values when you need alpha transparency with broad browser support
  • Document color palette in both HEX and HSL for designer-developer handoff consistency
  • Use the CSS Minifier after finalizing color values in production stylesheets
  • Avoid hardcoding colors in components — reference design system tokens instead

Related Tools

Frequently Asked Questions

HEX (#rrggbb), RGB, RGBA, and HSL.