FREE
Loading…
Convert colors between HEX, RGB, and HSL formats instantly. Use the color picker or type any hex code.
Color Converter
Processing…
FREE
Loading…
Color Converter is a free online tool that translates a single color between HEX, RGB, and HSL notation at the same time. Pick a color with the native browser color picker or type a hex code directly, and all three representations — plus a live preview swatch — update immediately. Every value comes with its own copy button so you can grab exactly the syntax your stylesheet, design tool, or codebase expects.
These three formats all describe the same underlying color, just structured differently for different purposes. HEX (#RRGGBB) packs red, green, and blue into a compact six-character string using hexadecimal pairs — it's the format most design tools export by default and the shortest to type for a solid color. RGB spells out the same three channels as plain decimal numbers from 0-255, and its rgba() variant adds a fourth alpha channel for transparency, which HEX alone can't express without an extended 8-digit form. HSL takes a completely different approach: instead of channel intensities, it describes color the way a human actually thinks about it — hue as a position on a 360° color wheel, saturation as how vivid or muted the color is, and lightness as how close it sits to black or white.
That distinction matters in practice. If you're building a design system and want five shades of the same brand blue, HSL makes it trivial — keep hue and saturation fixed and step lightness up or down in increments. Trying to do the same thing by eyeballing RGB or HEX values is much harder because the three channels don't correspond to "lighter" or "darker" in any intuitive way. Conversely, HEX remains the most compact and most widely supported format for pasting a color once into CSS, Figma, or a config file.
This tool also matters for cross-tool workflows: a designer hands you a HEX value from Figma, but your CSS custom properties are defined in HSL for easier theming, or you need the RGB breakdown to compute a WCAG contrast ratio by hand. Rather than doing the arithmetic yourself, paste the value in and read off whichever format you need. Everything runs client-side in your browser — no color values are ever sent to a server.
The tool first normalizes your hex input, expanding 3-digit shorthand (#RGB) to full 6-digit form (#RRGGBB) if needed, then parses it into red, green, and blue integer channels (0-255) using base-16 parsing on each byte pair. From there it applies the standard RGB-to-HSL formula: it finds the maximum and minimum channel values to compute lightness, derives saturation from the spread between those values relative to lightness, and determines hue based on which channel (R, G, or B) was the maximum. All three outputs — HEX, RGB, HSL — are then formatted exactly as you would write them in a CSS file, and the whole calculation runs synchronously in JavaScript with no network request involved.
Enter a hex color value
Type a hex code into the input field — either 3-digit shorthand (#F53) or full 6-digit form (#FF5733).
Or pick visually
Click the color swatch to open your browser's native color picker and select a color by eye.
Convert
Click Convert Color. The RGB and HSL equivalents are calculated and displayed alongside a live preview swatch.
Check the preview
The large swatch above the results shows exactly how the color renders, useful for confirming it matches what you intended.
Copy any format
Click the copy button next to HEX, RGB, or HSL to copy that specific CSS-ready string for use in your project.
Web & UI Design
Convert a brand color from its HEX code to RGB and HSL so you can use it consistently across plain CSS, Tailwind config, and design tokens.
Design System Maintenance
Translate colors when moving from a Figma export (usually HEX) to HSL-based CSS custom properties, which make building light/dark theme variants far easier.
Image Editing Workflows
Get the exact RGB breakdown of a color you sampled in Photoshop, GIMP, or a photo editor so you can reproduce it precisely in code.
Accessibility Contrast Checking
Pull RGB or HSL lightness values to manually sanity-check whether a foreground/background pairing is in the right ballpark for WCAG contrast requirements.
Color Palette Exploration
Use the native color picker to explore hues visually and watch all three format representations update live as you drag across the picker.
Copy for Code
Grab the exact CSS-ready HEX, rgb(), or hsl() string for a color in one click and paste it straight into a stylesheet or component.
Three Formats Simultaneously
HEX, RGB, and HSL are all displayed at once, so you never have to run the same color through three separate lookups.
Native Color Picker
The built-in browser color picker lets you select any hue visually and immediately see its equivalent values in all three formats.
Live Color Swatch
A large preview block shows the actual rendered color, giving instant visual confirmation that what you typed matches what you intended.
CSS-Ready Output
Every value is formatted exactly as you would write it in a stylesheet — #RRGGBB, rgb(r, g, b), and hsl(h, s%, l%) — ready to paste without edits.
Handles Shorthand Hex
Accepts both 3-digit shorthand (#RGB) and full 6-digit (#RRGGBB) hex codes, automatically expanding shorthand before converting.
Fully Client-Side
Color conversion happens entirely in your browser with no network requests involved, so results are instant and your palette stays private.
Also Known As
Binary To Decimal
Convert between binary, decimal, hex and octal number systems
Convert Binary
Convert binary numbers to text and text to binary
Convert Timestamp
Convert Unix epoch timestamp to standard date format and back
Count Words
Count words, characters, sentences and paragraphs in text
Convert Datetime
Convert datetime between different formats and timezones
Encode Image to Base64
Encode any image file to Base64 string for embedding in HTML or CSS
Trusted Worldwide
iLoveDocsTools is used by students, professionals, and businesses across the United States, Canada, United Kingdom, Australia, India, and more than 100 other countries. All tools are browser-based and process files privately — your files never leave your device. Free to use, with Pro plans for unlimited access.
All processing happens directly in your browser. Your documents are never sent to any server — complete privacy guaranteed for users in the USA, Canada, UK, and worldwide.
Every tool on iLoveDocsTools is free to use. Need more? Upgrade to Pro for unlimited usage, priority access, and no daily limits. Trusted by students, freelancers, and teams across North America and Europe.
Whether you are on a Mac, Windows PC, iPhone, or Android in New York, Toronto, London, or Sydney — our tools work instantly in any modern browser.
Looking for free PDF tools in the USA? Free document converters in Canada? Online PDF editors in the UK or Australia? iLoveDocsTools offers 70+ free tools — merge PDF, split PDF, compress PDF, convert Word to PDF, Excel to PDF, JPG to PDF, and many more — all free, all instant, all private. No watermarks. No file size limits. Just free tools that work.