Developer Tools

Color Converter

Convert HEX, RGB and HSL colors locally, including transparency. Preview the color, choose an opaque color with the picker, and copy individual formats or download a report.

Your content stays on your device Free, with no account
One color. Three useful formats. sRGB · local conversion
HEX requires #. Functions support comma syntax or space syntax with optional / alpha. Up to 200 characters.
Choosing a color replaces your input and sets alpha to 1.

Accepted examples

#09F · #345BE880 · rgb(52, 91, 232) · rgb(20% 40% 60% / 50%) · hsl(227deg 80% 56% / 0.5)

RGB: 0–255 or three percentages. HSL: hue in degrees; saturation/lightness require %. Alpha: 0–1 or 0–100%. Out-of-range values are rejected rather than clamped.

YOUR COLOR

Ready. Enter a color or use the picker.

RGB channels round to 8-bit integers before conversion. HEX alpha rounds to 8 bits; HSL and decimal alpha show up to six decimals. Small differences can occur on round trips. Checkerboard indicates transparency; this is not a contrast or accessibility assessment.

A FEW SIMPLE STEPS

How to use Color Converter

  1. Enter a HEX color with # or an RGB/HSL function, or select Try an example.
  2. Optionally choose an opaque color with the picker. This replaces the input and sets alpha to 1.
  3. Select Convert color to preview it and review HEX, RGB and HSL values.
  4. Copy an individual format, copy the full report or download a text file. Input edits clear the old result.
PRIVATE BY DESIGN

Why use this tool?

Colors are parsed and converted on your device without uploads, APIs, accounts or input history. The tool produces useful CSS representations, with explicit rounding rules and a local transparency preview.

Tool inputs stay in your browser. Only your theme preference is saved on this device.

A few things worth knowing

Which color formats can I enter?

HEX supports #RGB, #RGBA, #RRGGBB and #RRGGBBAA. RGB/RGBA and HSL/HSLA functions accept comma-separated channels or space-separated channels with optional slash alpha. RGB channels must be all numbers from 0 to 255 or all percentages. HSL accepts degree hue (optional deg suffix) and percentage saturation/lightness. Alpha accepts 0–1 or 0–100%. Input is limited to 200 characters.

Does this accept every CSS color?

No. This tool implements a deliberate subset: no named colors, currentColor, none, CSS variables, calc(), relative colors, scientific notation, mixed RGB channel units, multiline functions, angle units other than degrees, or wider-gamut formats such as Display P3, Lab and OKLCH. Out-of-range channels are rejected instead of clamped. Hue may be between -1,000,000 and 1,000,000 degrees and wraps into a full turn.

How are transparency and rounding handled?

RGB channels are rounded to nearest 8-bit integers before output and HSL calculation. Alpha is retained numerically for RGB/HSL, displayed to six decimals. HEX alpha is rounded to an 8-bit byte, so 0.5 becomes 80 in HEX and converts back to approximately 0.501961. HSL channels are displayed to six decimals. Tiny rounding differences can occur on round trips. Opaque HEX output omits the alpha byte.

What happens to gray colors and hue?

RGB colors with equal red, green and blue channels have no distinct hue. Their normalized HSL output uses hue 0 and saturation 0. Because HSL output is derived from normalized 8-bit RGB, your original HSL spelling and hue for achromatic colors are not preserved.

What does the checkerboard preview show?

It shows the normalized RGB color and alpha composited over alternating light and dark squares. It is a visual aid, not a contrast check, color calibration or accessibility assessment. Display appearance depends on the browser and screen. The native picker chooses opaque colors and replaces any existing alpha.

Is any color input stored or sent elsewhere?

No. Conversion runs in JavaScript on your device, with no API calls, uploads or saved input history. Copy and download happen only when selected. The report contains converted values and rounding notes.