Skip to main content

Color Format Converter

Convert between HEX, RGB, and HSL color formats instantly. Type any value in any field — all other formats update automatically. Use the color picker for visual selection or pick from presets.

✓ 60K+ developers trust DevPlaybook ✓ Runs 100% in your browser ✓ No sign-up required

Real-World Use Cases

1. Figma-to-CSS Design Handoff

Your designer exports brand colors from Figma as HEX. You need HSL values for CSS custom properties to build light/dark theme variants by adjusting lightness.

Input (from Figma)

#6366F1

Converted Formats

RGB: rgb(99, 102, 241)
HSL: hsl(239, 84%, 67%)

Dark variant: hsl(239, 84%, 45%)
Light variant: hsl(239, 84%, 85%)

2. Tailwind CSS Custom Color Configuration

You want to add a brand color to your tailwind.config.js. Convert the designer's RGB value to HEX for the config file.

Input (from design spec)

rgb(16, 185, 129)

For tailwind.config.js

HEX: #10B981

// tailwind.config.js
colors: {
  brand: '#10B981'
}

3. Accessibility Contrast Debugging

WCAG requires a 4.5:1 contrast ratio for text. Convert your background and text colors to RGB to calculate the ratio, or adjust the HSL lightness until contrast passes.

Background Color

#F3F4F6 → rgb(243, 244, 246)
         hsl(220, 14%, 96%)

Text Color (adjust lightness)

#6B7280 → hsl(220, 9%, 46%)

Contrast: 4.6:1 WCAG AA pass
Darken to hsl(220, 9%, 35%)
for AAA compliance (7:1).

How to Use — Step by Step

  1. Enter any color value — Paste a HEX code (e.g. #6366F1), RGB value (e.g. rgb(99,102,241)), or HSL value into any input field.
  2. See instant conversion — All other format fields update automatically. No button needed — conversion happens as you type.
  3. Use the color picker — Click the visual picker to select a color visually, then read off the HEX, RGB, and HSL values.
  4. Try presets — Click any preset color to load its values instantly. Great for exploring Tailwind or Material Design palettes.
  5. Copy to clipboard — Click the copy icon next to the format you need and paste directly into your CSS, Tailwind config, or design token file.

Frequently Asked Questions

What color formats can I convert?▼

This tool converts between HEX (e.g. #ff6b6b), RGB (e.g. rgb(255, 107, 107)), and HSL (e.g. hsl(0, 100%, 71%)) formats. All fields update automatically when you type in any one of them.

How do I convert HEX to RGB?▼

Paste your HEX value (with or without the # prefix) into the HEX field. The RGB and HSL values update instantly. No button to click — it's real-time conversion.

What is the difference between RGB and HSL?▼

RGB (Red, Green, Blue) defines colors by mixing light channels with values 0–255. HSL (Hue, Saturation, Lightness) is more intuitive for designers — Hue is the color angle (0–360°), Saturation is intensity (0–100%), and Lightness is brightness (0–100%).

Does this tool work with CSS color values?▼

Yes. The HEX, RGB, and HSL outputs are valid CSS color values you can paste directly into your stylesheets. For example: color: #ff6b6b or background: hsl(0, 100%, 71%).

Is the color picker accurate for web colors?▼

Yes. The visual color picker uses your browser's native color input, which produces precise HEX values. All converted outputs are mathematically accurate and browser-safe.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →