Preparing your generator page
We are loading content and tools so everything is ready to use.
We are loading content and tools so everything is ready to use.
Convert one color between HEX, RGB, and HSL. Edit any format, watch the swatch, and copy the string you need. The page opens on #2D6CDF, which is rgb(45, 108, 223) and hsl(219, 74%, 53%). Random color can return any of the 16,777,216 colors in 24-bit sRGB. There is no alpha, no color name, and no contrast score on this page.
For a CSS name and a contrast check, use HEX Code to Color Name. For a two-stop background, use the CSS Gradient Generator. More helpers are in Utility tools.
Last updated: October 8, 2026 · Published: 2026-04-09 · Updated: 2026-10-08
Color preview
HEX: #2D6CDF
RGB: rgb(45, 108, 223)
HSL: hsl(219, 74%, 53%)
Use HEX for design tools, RGB for CSS rgba-based workflows, and HSL for shade/lightness adjustments.
HEX, RGB, and HSL are three ways to write the same sRGB color. HEX is six hexadecimal digits. RGB is three channels from 0 to 255. HSL restates that color as a hue angle plus saturation and lightness percents. A converter keeps them aligned so a design file, a CSS rule, and a brand sheet do not drift apart.
This page does that for one color at a time. The swatch, the three readouts, and the copy buttons all refer to the current value. It does not invent a palette, look up a name such as “dodger blue,” or tell you whether the color passes WCAG against white. Those jobs belong to other tools linked below.
Conversion stays in the browser. Copying a code does not send it to Muxgen.
Four steps from a typed value to a copied CSS color.
Type a 6-digit HEX and leave the field, or change R, G, B, H, S, or L. The other two formats follow.
The preview uses the current HEX. If the HEX box is not six valid digits, the swatch stays on the last RGB color.
Copy HEX, Copy RGB, or Copy HSL. Each button copies only that format.
Random color draws three bytes from 0 to 255 and rewrites HEX, RGB, and HSL together.
Limits match the fields on this page.
| Setting | This generator |
|---|---|
| Color model | sRGB, 8 bits per channel |
| Formats | HEX, rgb(), and hsl() |
| HEX | Exactly 6 digits; applied on blur; copied as #RRGGBB |
| RGB range | 0–255 for R, G, and B |
| HSL range | H 0–360, S 0–100%, L 0–100% |
| Default | #2D6CDF · rgb(45, 108, 223) · hsl(219, 74%, 53%) |
| Random set | 16,777,216 colors (256³) |
| Alpha | Not included |
| Color names | Not on this page |
| Contrast | Not calculated here |
HEX commits when you leave the box. RGB and HSL commit on each change.
Six hex digits, optional leading #. The value is applied when you leave the field. Shorthand #RGB is ignored. Copy writes uppercase with #.
Integers from 0 to 255. They update HEX and HSL as you type. Copy writes rgb(R, G, B) with spaces.
Hue 0–360, saturation and lightness 0–100. They update HEX and RGB as you type. Copy writes hsl(H, S%, L%).
Three independent channel bytes. 16,777,216 possible results. Uses crypto.getRandomValues when the browser has it.
A single flat preview of the current HEX. No gradient, no alpha, no surrounding palette.
Three separate copies. The page does not bundle them into one stylesheet or CSS variable.
The same default blue, written three ways.
| Format | Copied example | What it means |
|---|---|---|
| HEX | #2D6CDF | Same 24 bits as RGB, written as two hex digits per channel, # included on copy. |
| RGB | rgb(45, 108, 223) | Red, green, and blue from 0 to 255. This is the CSS rgb() form without a fourth alpha value. |
| HSL | hsl(219, 74%, 53%) | Hue in degrees, then saturation and lightness as percents. Integers only, so it is a rounded view of the RGB color. |
In CSS those strings drop straight into a property: color: #2D6CDF;, color: rgb(45, 108, 223);, or color: hsl(219, 74%, 53%);. This page does not emit rgba() or hsla().
#2D6CDF splits into channels 0x2D, 0x6C, and 0xDF. In decimal that is 45, 108, and 223. Blue is the largest channel, so the hue sits in the blue sector of the wheel: 219 degrees. Saturation rounds to 74% and lightness to 53%.
Random color ignores that blue. It draws a new byte for each channel, which is every integer from 0 through 255 with equal chance. Three channels give 256³ = 16,777,216 colors. The draw uses crypto.getRandomValues when the browser has it.
RGB channels are integers. HSL on this page is also integers: degrees and percents, not decimals. Turning those rounded HSL numbers back into RGB rounds again. One channel can move by 1, and the HEX digits change with it. That is expected. If you need the exact hex you started with, copy HEX before you edit H, S, or L.
Hue 360 is clamped as a legal input and then treated as the same angle as 0, so both ends of the wheel match.
Three different “color code” jobs. Only one of them is this converter.
| HEX / RGB / HSL | HEX Code to Color Name | Minecraft color codes | |
|---|---|---|---|
| What you get | One web color in three notations | Closest of 148 CSS names, plus OKLCH and contrast | Formatting codes for chat and signs |
| Typical paste target | CSS, Figma, a brand kit, a QR color picker | A label such as royalblue next to the code | A server motd, sign, or plugin string |
| Alpha | Add it yourself; this page has none | See that tool for the values it prints | Not an opacity channel |
The Minecraft Color Code Generator is for § and & codes. The CSS Gradient Generator builds a gradient from colors you already chose. QR foreground hex can go into the Canva QR Code Generator or the Adobe QR Code Generator.
One swatch, pasted into the tool that asked for that notation.
Paste #2D6CDF, rgb(45, 108, 223), or hsl(219, 74%, 53%) into color, background, or border.
Lock a 6-digit hex, then copy the RGB form for a file that expects channels instead of a hash.
Change L and copy the new HEX. Saturation stays put while lightness moves.
Copy HEX into the Canva or Adobe QR generators. Dark modules on a light field scan more reliably.
Use Random color when a mock UI needs a swatch and the exact hue does not matter.
One swatch shows that HEX, RGB, and HSL are three writings of one sRGB color, not three different colors.
Short definitions for the words on this page.
A 24-bit sRGB color written as # plus six hexadecimal digits, two each for red, green, and blue.
Red, green, and blue channels as integers from 0 to 255. This page copies them as rgb(R, G, B).
Hue (0–360), saturation (0–100%), and lightness (0–100%). A different coordinate system for the same sRGB color.
The standard web color space these three formats describe. This tool does not convert to CMYK or OKLCH.
One of R, G, or B. Eight bits means 256 steps, from 0 through 255.
8 bits × 3 channels = 16,777,216 distinct RGB triples. Random color can return any of them.
The angle around the color wheel. 0 and 360 are the same position in this converter.
The L percent in HSL. 0% is black, 100% is white, and 50% is the middle of that hue and saturation.
Opacity from transparent to solid. This generator does not include it. CSS rgba() and hsla() add that fourth number.
HEX, RGB, and HSL conversion, the default blue, random colors, rounding, alpha, and how this differs from Minecraft codes.
Explore more tools in the directory.
Nearest CSS color name, OKLCH, and WCAG contrast for a hex, rgb(), or hsl() value.
Linear and radial gradients once you have two or more stops.
Foreground and background hex for a QR you upload to Canva.
The same hex color pickers for a QR aimed at Express or print.
§ and & formatting codes for Minecraft chat, signs, and plugins.
Glow treatments after you have picked a base color.