🧰FileTools

HEX to RGB Color Converter

Convert HEX color codes to RGB and vice versa. Supports #fff shorthand, #aabbcc longhand, and rgb() output. Free, browser-based, no upload.

🔒 Tus archivos nunca salen de tu dispositivoMax 1MB.txt
⬆

Arrastra tu archivo aquí, o haz clic para explorar

Compatible con: .txt · Máx: 1MB

📘 Cómo usar

Guía disponible en inglés. Traducción automática próximamente.

How to Convert HEX to RGB (and Back)

What This Tool Does

The HEX to RGB Color Converter translates between the two most common web color formats: hexadecimal (#RRGGBB) and decimal rgb(r, g, b). Paste a color code, get the equivalent representation instantly — no file upload needed.

HEX vs RGB: When to Use Each

HEX notation (#1a2b3c) is the most compact color format and dominates in CSS, design tools, and image formats. RGB notation rgb(26, 43, 60) is more readable when you need to reason about individual channel values, and it is required for CSS color functions like rgba() where you need to add an alpha channel. Converting between them is a frequent task when bridging design mockups and production CSS.

Supported Formats

HEX input: the tool accepts #RGB shorthand (#fff), #RRGGBB longhand (#ffffff), and bare hex digits without the hash (1a2b3c). Uppercase and lowercase are both handled. Invalid or ambiguous input returns a clear error message instead of a wrong result.

RGB input: rgb(r, g, b) and bare "r, g, b" triplets are accepted. Each channel value must be an integer from 0 to 255. Values outside that range produce an error.

How to Use

  1. Paste your color code into the input area (or drop a .txt file).
  2. Select the direction: hex-to-rgb or rgb-to-hex.
  3. Click Convert. The result appears with a copy-ready string and a live color preview.
  4. Download or copy the result for use in your CSS.

When You Need HSL or OKLCH

Modern CSS supports hsl() and oklch() for perceptual color manipulation. If you need those, a color format matrix tool is on our M2 roadmap — for now, convert to RGB first, then transform in your CSS preprocessor.

❓ Preguntas frecuentes

Does it support 3-digit hex shorthand like #fff?

Yes. The converter accepts both #RGB shorthand and #RRGGBB longhand. Shorthand is expanded to longhand before conversion.

Can I convert RGB back to HEX?

Yes. Select the rgb-to-hex direction, paste your rgb(r, g, b) value, and get the hex equivalent with a leading #.

Is my data uploaded anywhere?

No. All conversion happens in your browser. Your color codes never leave your device.