Skip to main content

Color Converter

Convert a colour between HEX, RGB, and HSL notation, with a live preview.

All three describe the same colours; they differ in how easy they make it to reason about and adjust them.

This tool runs entirely in your browser

This tool runs entirely in your browser. The data you paste is processed on your device and never sent to Filorra.

That is not a small detail for developer tools. API responses, tokens, config files, and log excerpts routinely contain credentials and customer data, and pasting them into a server-side tool means disclosing them to a third party.

How to use Color Converter

  1. Enter a colour

    Any of the three formats is accepted.

  2. Read the equivalents

    The other notations update immediately alongside a preview swatch.

  3. Copy the format you need

    Take the value straight into your stylesheet or design tool.

Why HSL is worth switching to

HEX and RGB describe a colour as amounts of red, green, and blue. That maps to how a screen works and not at all to how people think about colour.

Asked to make `#3B82F6` 20% darker, you cannot do it in your head — the relationship between the digits and the perceived colour is not intuitive.

HSL splits the colour into hue (position on the colour wheel, 0-360), saturation (how vivid, 0-100%), and lightness (how light, 0-100%). Now the same question is trivial: reduce the lightness. Want a muted version? Lower the saturation. Want the complementary colour? Add 180 to the hue.

This is why HSL is the practical choice for building a palette. Take one hue, hold it constant, and vary lightness to produce a coherent set of tints and shades — the approach behind most modern design systems, and the reason their palettes look deliberate rather than assembled.

Shorthand HEX and alpha

Three-digit HEX is shorthand where each digit is doubled: `#F00` expands to `#FF0000`. It is convenient but only reaches 4,096 of the 16.7 million available colours, so most real colours cannot be written that way.

Both HEX and RGB support transparency. Eight-digit HEX appends two alpha digits, so `#FF0000` at half opacity is `#FF000080`. `rgba()` and `hsla()` take an alpha value from 0 to 1, and modern CSS also accepts a slash inside `rgb()` and `hsl()`.

A practical distinction that catches people: a semi-transparent colour blends with whatever sits behind it, while an opaque colour that looks similar does not. If an element sits over varying backgrounds, transparency and a fixed light colour produce visibly different results.

Contrast is not something you can judge by eye

Converting between formats does not tell you whether text will be readable, and designers routinely overestimate the contrast of their own palettes.

WCAG defines a contrast ratio between foreground and background: 4.5:1 is required for normal body text at AA, and 3:1 for large text. AAA raises those to 7:1 and 4.5:1.

Light grey text on white is the most common failure. It looks refined on a bright calibrated monitor and becomes unreadable on a phone outdoors, or for anyone with reduced contrast sensitivity — which includes a large share of readers over 40. Check the ratio with a contrast tool rather than trusting the impression.

When to use Color Converter

  • Converting a brand colour from a design file into a CSS value.
  • Building a set of tints and shades from a single base hue.
  • Translating between the formats a design tool and a codebase each expect.
  • Working out the HSL equivalent of a colour so you can adjust it systematically.

Common problems

The colour looks different in my design tool.
Colour profile differences. Design tools may work in a wider gamut than the browser's sRGB, so the same numbers can render differently.
My three-digit HEX will not represent the colour I want.
Shorthand only reaches 4,096 colours. Use the full six-digit form.
Transparency is not working.
Use eight-digit HEX or the rgba/hsla forms. A six-digit HEX is always fully opaque.
My text is hard to read on this background.
Check the contrast ratio against WCAG — 4.5:1 for body text. Format conversion does not tell you anything about readability.

Frequently asked questions

Is my data sent anywhere?
No. Conversion happens entirely in your browser.
Which format should I use in CSS?
All three work. HSL is easiest to adjust systematically, which makes it the better choice when building a palette.
What does the fourth value in rgba mean?
Alpha — opacity from 0 (fully transparent) to 1 (fully opaque).
Why does #F00 work as a colour?
It is three-digit shorthand where each digit is doubled, expanding to #FF0000.

Learn more

Guides and answers that explain how this tool's job actually works.