Перейти к основному содержимому
FreeOnlineTools Go
Русский
how-to

Как конвертировать цвета между HEX, RGB и HSL

By FreeOnlineTools Team · Updated 2026-09-02

Quick Answer

Чтобы конвертировать цвет: откройте Color Converter, введите цвет в любом формате (HEX, RGB, HSL) и инструмент мгновенно покажет эквиваленты во всех других форматах. Вся конвертация локально —данные не загружаются.

Introduction

Цвета могут быть представлены в нескольких форматах: HEX (#ff6600), RGB (rgb(255, 102, 0)), HSL (hsl(24, 100%, 50%)) и других. Разные инструменты и контексты используют разные форматы —CSS часто HEX или RGB, design tools HSL, а API любой. Конвертация между форматами позволяет использовать цвет из одной системы в контексте, требующем другой.

Step by Step

  1. Open the Color Converter tool

    Go to the Color Converter tool page. The tool supports HEX, RGB, HSL, HSV, and CMYK formats.

  2. Enter your color

    Type or paste a color value in any supported format. Examples: '#ff6600', 'rgb(255, 102, 0)', 'hsl(24, 100%, 50%)'. The tool auto-detects the input format.

  3. Review all format equivalents

    The tool displays the color in all formats simultaneously: HEX, RGB, HSL, HSV, and CMYK. It also shows a color preview swatch so you can verify the conversion is correct.

  4. Copy the format you need

    Click the Copy button next to any format to copy that value to your clipboard. Use it in your CSS, design tool, or application.

  5. Adjust the color (optional)

    Some tools let you adjust the color with sliders (for HSL: hue, saturation, lightness) and see all formats update in real time. This is useful for finding related colors or shades.

Examples

HEX to RGB and HSL

Input: #ff6600

Output: RGB: rgb(255, 102, 0) HSL: hsl(24, 100%, 50%)

RGB to HEX

Input: rgb(0, 128, 255)

Output: HEX: #0080ff HSL: hsl(210, 100%, 50%)

HSL to HEX

Input: hsl(120, 100%, 50%)

Output: HEX: #00ff00 RGB: rgb(0, 255, 0)

Common Problems

  • HEX with vs without # —some tools require the # prefix, others do not. Our converter accepts both.
  • 3-digit vs 6-digit HEX —#f60 is shorthand for #ff6600. Both are valid; the converter normalizes to 6 digits.
  • HSL hue range —hue is 0-360 degrees (a circle). 0 and 360 are both red. Values above 360 wrap around.
  • Color space differences —HEX, RGB, and HSL are all sRGB. CMYK is a different color space (print) and conversion is approximate.

Tips

  • Use HSL for creating color variations —adjusting hue, saturation, or lightness is more intuitive than RGB.
  • Use HEX for CSS —it is the most compact and widely supported format in stylesheets.
  • Use RGB when you need to set alpha transparency —rgb(255, 102, 0, 0.5) for 50% opacity (or use 8-digit HEX: #ff660080).
  • Use our Color Converter for instant, private conversion between all color formats.

Related Tools

Related Guides

References