⚙️ Nástrojárna Fast free tools, right in your browser. CZEN

Color converter (HEX ↔ RGB)

This color converter translates any color between HEX notation (e.g. #2563eb) and RGB (red, green, blue) and instantly shows a live preview. It is handy for web developers, designers and anyone who needs to rewrite a color from one format to the other. Everything is computed right in your browser — no data ever leaves your device and no sign-up is required.

How the color converter works

A color on screen is made of three light components — red (R), green (G) and blue (B), each ranging from 0 to 255. This is called the RGB model. HEX is simply another way to write exactly the same information: each of the three components is written as a pair of hexadecimal digits (0–9 and A–F), so 00 means 0 and ff means 255. The code #2563eb therefore consists of 25 (red = 37), 63 (green = 99) and eb (blue = 235).

The tool works in both directions. When you edit the HEX field, it splits the code into three pairs and converts each into a decimal number from 0 to 255. When you change any of the R, G, B fields, it does the reverse: it writes each number as two hexadecimal digits and joins them into a single #RRGGBB code. It also supports the shorthand three-character notation#f0c automatically expands to #ff00cc. The color swatch below the fields always shows the resulting color.

How to use the color converter

  1. Type a color code into the HEX field (with or without the hash, six or three characters).
  2. The R, G, B values and the preview update instantly.
  3. The other way round: overwrite any of the R, G, B numbers and the HEX field is filled in for you.
  4. Copy the resulting HEX code or the RGB triplet into your CSS, graphics editor or document.

Conversion example:

HEXRGB
#2563eb3799235
#ffffff255255255
#000000000
#f0c → #ff00cc2550204

What the color converter is good for

The most frequent users are web developers and coders: CSS accepts both notations, but a color picker in a graphics program often outputs only RGB while you need the code in HEX (or vice versa). It is also useful for designers unifying a palette, for creators of email templates where HEX is the standard, and for students learning how on-screen colors are composed. Because the whole calculation runs locally in your browser, you can use it offline and no entered color is ever sent anywhere.

FAQ

What is the difference between HEX and RGB?

They are just two ways of writing the same color. RGB gives three numbers from 0–255 for the red, green and blue components. HEX writes those same three values in hexadecimal as a six-digit #RRGGBB code. Both describe an identical color.

Do I have to type the # before a HEX code?

No. The tool adds and removes the hash for you, so <code>2563eb</code> and <code>#2563eb</code> both work. The result shows the hash because that is how the code is written in CSS and HTML.

What does a three-character HEX like #f0c mean?

It is a shorthand where each digit is doubled. So <code>#f0c</code> equals <code>#ff00cc</code>. It only works when each component can be written with a single repeated digit; otherwise the full six-character code is needed.

Does the tool support transparency (alpha channel)?

No. It converts only the base color in RGB format and the six-character HEX. Eight-character HEX with transparency (#RRGGBBAA) and RGBA notation are not converted by this tool.

Why did nothing change after I entered an incomplete HEX code?

The tool recalculates RGB only when the HEX is valid — that is, exactly three or six characters from the range 0–9 and A–F. While you are still typing an unfinished code, the values wait rather than show nonsense.

Are the letters in a HEX code case sensitive?

No. <code>#FF00CC</code> and <code>#ff00cc</code> mean the same color. The tool accepts both uppercase and lowercase; the output is usually lowercase.

Is my color sent to a server?

No. The whole conversion happens entirely in your browser using JavaScript. Nothing is uploaded, stored or sent, and the tool works even without an internet connection.

How do I put the color into CSS?

In CSS you can use either notation: HEX as <code>color:#2563eb</code>, or RGB as <code>color:rgb(37, 99, 235)</code>. Just copy whichever suits you.

Sources & standards

📅 Last updated: 16 July 2026