CSS Color Code Converter
Enter a CSS color keyword and click Resolve to convert to HEX/RGB/HSL.
#3b82f6
rgb(59, 130, 246)
hsl(217, 91%, 60%)
About this Tool
Convert color values across HEX/HEXA, RGB/RGBA, HSL/HSLA, and CSS color keywords with synchronized inputs and a live preview. Perfect for designers and developers ensuring color consistency across tools and code.
The converter parses the input format and normalizes to RGBA. RGB and HSL are converted using standard color space math. HEX/HEXA values are generated from the RGBA channels. CSS keywords are resolved by applying the keyword to a temporary element and reading the computed RGB value from the browser.
- Enter a color in any format: HEX/HEXA, RGB/RGBA, or HSL/HSLA.
- Use the alpha slider to adjust transparency (applies to RGBA/HSLA/HEXA).
- Optional: type a CSS color keyword (e.g., rebeccapurple) and click Resolve to convert it.
- Click Copy on any format to copy the current color string to the clipboard.
- Convert a HEX brand color to HSL to create lighter/darker variants using the Lightness channel.
- Convert an RGBA overlay to HEXA for use in CSS variables.
- Translate a designer-provided HSL color to RGB for a canvas drawing routine.
- Bidirectional synchronization across HEX, RGB, and HSL inputs.
- HEXA and alpha support with a dedicated transparency slider.
- CSS keyword resolver (e.g., tomato, slateblue).
- Live preview swatch with brand-styled UI.
- Validation with clear error messages.
- All operations run locally in your browser.
RGB is an additive color model represented by red, green, and blue channels (0-255). HSL is a cylindrical representation with hue (0-360), saturation, and lightness (0-1). HEX is a compact hex-encoded representation of RGB (with optional alpha for HEXA). Conversions use deterministic formulas between these spaces.
Does it support alpha?
Yes. The alpha slider updates RGBA/HSLA and HEXA outputs. HEX (without alpha) is also available.
Can it handle short HEX like #abc?
Yes. 3-digit and 4-digit short HEX/HEXA are supported and expanded to full form internally.
Are named colors supported?
Yes. Enter a CSS color keyword (like rebeccapurple) and click Resolve.
All calculations and data processing for this tool are performed locally in your browser. We do not send any of your data to our servers, ensuring your information remains private and secure.