DevGizmo

Colour Code Converter

Convert colours between HEX, RGB, HSL and HSV formats with a live preview swatch.

About the Colour Code Converter

Colour values appear in many different formats across web development, design tools, and graphics programming. The DevGizmo Colour Code Converter accepts a colour in any supported format and instantly outputs all four representations — HEX, RGB, HSL and HSV — along with a live preview swatch so you can visually confirm the colour.

All conversions run entirely in your browser using mathematically precise formulas. No image processing libraries are used.

Supported Formats

  • HEX (#RRGGBB) — the standard web colour format used in CSS and HTML. Both 3-digit shorthand (#RGB) and 6-digit (#RRGGBB) are accepted. The output is always uppercase 6-digit hex.
  • RGB (Red, Green, Blue) — each channel ranges from 0 to 255. Used in CSS as rgb() and natively in most graphics APIs. Enter as 255, 128, 0 or rgb(255, 128, 0).
  • HSL (Hue, Saturation, Lightness) — a perceptual colour model where hue is a degree value 0–360, saturation and lightness are percentages 0–100%. Widely used in CSS and design tools because it maps more intuitively to how humans perceive colour.
  • HSV (Hue, Saturation, Value) — similar to HSL but uses Value (brightness) instead of Lightness. This is the model used by Adobe Photoshop, Figma, and most colour pickers.

Conversion Accuracy

All conversions are performed with floating-point arithmetic and rounded to the nearest integer for each channel. Minor differences of ±1 in the last digit can occur due to rounding when round-tripping through multiple formats, which is expected and consistent with how design tools handle the same conversions.