Color Converter

Convert colors between HEX, RGB, HSL, and HSB formats. Check contrast ratios, get Tailwind suggestions, and generate palettes.

About This Tool

The Color Converter translates colors between HEX, RGB, HSL, and HSB (also known as HSV) formats. It is essential for web developers and designers who need to switch between CSS color notations, design tool values, and Tailwind CSS utility classes.

Enter a color in any supported format or use the native color picker. All other representations update in real time. The tool also suggests the closest Tailwind CSS color class when a match is found — try our Tailwind Playground to preview classes live. For creating CSS gradients with your colors, use the Gradient Generator.

The Contrast Ratio section calculates the WCAG 2.1 contrast ratio between your chosen color and a configurable background color. It shows a live preview and reports the accessibility level — AAA (7:1), AA (4.5:1), AA Large (3:1), or Fail. This helps ensure your color choices meet accessibility standards.

The Palette Generator creates color harmonies based on color theory: complementary (opposite on the color wheel), analogous (adjacent), triadic (three evenly spaced), and split-complementary. Click any swatch to copy its hex value.

All processing happens client-side. Your colors are never sent to any server. Explore all CSS named colors with detailed explanations, or generate box shadows and text shadows using your chosen color values.

How to Use

  1. Select an input mode: HEX, RGB, HSL, HSB, or Picker.
  2. Enter a color value. All other formats update automatically.
  3. View the color preview swatch and copy any format using the copy icon.
  4. In the Contrast Ratio section, set a background color to check WCAG accessibility compliance.
  5. Use the Palette Generator to explore color harmonies. Click a swatch to copy its hex value.
  6. Press Ctrl+Shift+C to copy the HEX value.

FAQ

What is the difference between HSL and HSB?

Both use Hue and Saturation, but differ in the third component. HSL uses Lightness (0% = black, 100% = white, 50% = full color). HSB uses Brightness (0% = black, 100% = full color). Design tools like Figma and Photoshop typically use HSB, while CSS uses HSL.

What WCAG contrast ratio do I need?

WCAG 2.1 requires a minimum contrast ratio of 4.5:1 for normal text (Level AA) and 7:1 for enhanced contrast (Level AAA). Large text (18pt+ or 14pt bold) requires only 3:1 for Level AA.

How does the Tailwind CSS suggestion work?

The tool compares your color against a built-in palette of common Tailwind CSS colors. If an exact match is found, it shows the class name. If a close match (within a small color distance) is found, it shows it prefixed with ~ to indicate an approximation.

What are complementary and analogous colors?

Complementary colors are opposite each other on the color wheel (180 degrees apart) and create high contrast. Analogous colors are adjacent (30 degrees apart) and create harmonious, low-contrast combinations.

Is my data safe?

Yes. All color calculations run locally in your browser. No data is sent to any server.

Related Tools

CSS Layout Generator

Visually build Flexbox and CSS Grid layouts with live preview and generated CSS code.

Meta Tag Generator

Generate HTML meta tags, Open Graph, and Twitter Card tags with live SNS preview.

JSON Formatter

Format, validate, and beautify JSON with syntax highlighting and tree view.

Regex Tester

Test regular expressions with real-time match highlighting and capture groups.

Flexbox Playground

Experiment with all CSS Flexbox properties visually. Configure container and item settings with live preview and generated CSS code.

CSS Variable Generator

Design color theme systems with CSS custom properties. Auto-generate shade scales, semantic tokens, and dark mode variants.

Viewport Size Reference

Browse 60+ device viewport sizes for responsive web design. Compare iPhone, iPad, Android, laptop, desktop, and TV screen dimensions.

Font Stack Builder

Build CSS font-family stacks with drag-and-drop reordering, live preview, and popular presets for system, serif, sans-serif, and monospace fonts.

Accessibility Color Checker

Check WCAG 2.1 color contrast ratios for AA and AAA compliance. Test foreground and background color pairs with live preview.

SVG Path Editor

Visually edit SVG path d attributes with draggable control points, command palette, bezier curve handles, and real-time preview.

Color Palette Extractor

Extract dominant color palettes from images with HEX, RGB, HSL values. Export as CSS variables, Tailwind config, JSON, or SVG.

Image to ASCII Art

Convert images to ASCII art with customizable character sets, width control, color modes, and real-time preview.

Image Placeholder Generator

Generate custom placeholder images with configurable size, colors, text, and format. Download as PNG, JPEG, or SVG.

Design Tokens Generator

Generate design tokens as CSS custom properties, JSON, or SCSS variables.