Color Converter
Convert colours online between HEX, RGB, HSL and CSS formats with a live preview. Pick a colour or paste a HEX, RGB or HSL value to get every format.
Runs in your browser · Nothing uploadedFree · No sign-up
Something not working, or missing a feature? Send feedback
About the Color Converter
The Color Converter translates colours between HEX, RGB, HSL and CSS notations with a live swatch, which is handy when design tokens, CSS and design tools use different formats.
Conversion happens in your browser, so your files and records stay private.
How to use the Color Converter
- Enter a colour in any format or pick one.
- Read the equivalent HEX, RGB and HSL values.
- Copy the format you need.
Example
Input
#2563eb
Result
HEX #2563eb RGB rgb(37, 99, 235) HSL hsl(221, 83%, 53%)
With rgba(37, 99, 235, 0.5) as input, the alpha carries over: #2563eb80, rgba(37, 99, 235, 0.5) and hsla(221, 83%, 53%, 0.5).
Common mistakes
- Rounding in HSL. HSL values are rounded to whole numbers, so converting HSL back to HEX can differ by one in a channel. Keep the HEX or RGB value as the source of truth.
- Low contrast text. A colour that looks fine as a swatch may be unreadable as text. Aim for a contrast ratio of at least 4.5:1 against the background for body text (WCAG AA).
- Colour names and modern formats. Names such as rebeccapurple and newer formats such as oklch() are not parsed. Enter HEX, RGB or HSL.
Works well with the Color Converter
- CSS Gradient Generator: use the colours in a gradient.
- CSS Formatter: clean up the stylesheet that uses them.
- Number Base Converter: convert a hex channel such as eb to decimal.
Frequently asked questions
Why use HSL?
HSL makes it easy to create lighter, darker or less saturated variants of the same hue by changing one number.
Are transparent colours supported?
Alpha values are supported in RGBA, HSLA and 8-digit HEX.
What is 8-digit HEX?
The last two digits are the alpha channel: #2563eb80 is the same blue at 50% opacity. All current browsers support it in CSS.
Is RGB or HSL better in CSS?
They describe the same colours. HSL is easier to adjust by hand (lighter, darker, less saturated); RGB and HEX match what design tools export.
Guides and tutorials
- Programming Languages
Binary, Octal, Decimal and Hex: Number Bases for Programmers
How number bases work, converting binary, octal, decimal and hex by hand and in code, where each one appears, and the parseInt and precision traps to avoid.
· 5 min read
- Web Development
CSS Gradients: Linear, Radial and Conic with Practical Examples
Learn CSS gradients by example: angles, colour stops, hard stops, stripes, radial glows, conic charts, gradient text and borders, and smoother oklch blends.
· 5 min read
Related tools
JSON to CSV
Convert JSON arrays to CSV online with automatic column detection, nested object flattening and custom delimiters. Open the result in Excel or Sheets.
CSV to JSON
Convert CSV to a JSON array online with header detection, type inference and delimiter auto-detection. Turn spreadsheet exports into data for APIs and code.
JSON to XML
Convert JSON to well-formed XML online with a configurable root element and attribute support. Validate the input and download the XML file.
XML to JSON
Convert XML to JSON online, keeping attributes and turning repeated elements into arrays. Malformed XML is reported with its location.
JSON to YAML
Convert JSON to clean, human-readable YAML online. Turn API responses and package files into config for Kubernetes, Docker Compose or CI pipelines.
YAML to JSON
Convert YAML documents to formatted JSON online with syntax validation. Errors are reported by line, so broken indentation is quick to find and fix.