RGB ↔ Hex Converter

Convert colors in the browser: RGB ↔ Hex with live preview and copy buttons; HSL ↔ Hex with hue/saturation/lightness sliders; or paste hex, rgb(), or hsl() in All formats to emit hex, rgb/rgba, hsl/hsla, and a sample CSS variable line. Three-digit hex expands automatically — no server calls.

colorrgbhexhslcss

Category: Image & Graphics Tools

RGB

Hex

What does the RGB ↔ Hex Converter do?

This tool helps designers and developers keep palette values consistent across design files and code. Three tabs cover the workflows you use most: RGB ↔ Hex links three numeric channels to a single hex field with two-way updates, Copy hex, and Copy rgb(). HSL ↔ Hex drives hue (0–360), saturation, and lightness with sliders plus numeric inputs, then shows the matching hex (read-only on that tab) for quick export. All formats accepts one pasted string—#RGB or #RRGGBB, rgb()/rgba() with the first three channels, or hsl()/hsla() with degrees or bare numbers—and prints a grid of ready-to-paste strings including rgba(..., 1), hsla(..., 1), and a sample --color-primary: #...; line.

How parsing and rounding work

Hex shorthand triplets expand to six digits before conversion. RGB inputs clamp to 0–255 when you type channel values. HSL ↔ RGB uses standard textbook conversion with rounding on displayed H/S/L to one decimal for readability. The flexible parser is intentionally small: if your string does not match its patterns, you will see “Could not parse color.” Adjust spacing or format and try again.

Privacy

All conversions run in your browser. Dynamic Duniya does not receive your color strings for this tool.

Frequently Asked Questions

Does rgba() or hsla() alpha change the RGB output?

The flexible parser reads rgb/rgba and hsl/hsla but only uses the first three components to derive RGB; generated rgba/hsla strings in the output use an alpha of 1. For partial transparency, combine the RGB result with your own opacity in CSS.

Why does my hex look different from Figma or Photoshop?

Different apps may use different color profiles or gamma. This page assumes plain sRGB math from the numbers you enter.

Is the RGB ↔ Hex Converter free?

Yes for typical use on Dynamic Duniya.

Tips

Quick guidance for using our tools safely and effectively.

Privacy

Files are processed on the server for conversion only and are not used for training or shared with third parties.

Best results

Use the formats suggested in each tool. Large media files may take longer — keep the tab open until processing finishes.

Need something else?

Browse related tools below or explore other categories from the main Dev Tools hub.

Related tools

More utilities in the same category.

Image Compression

New

Compress JPEG, PNG, WebP, or GIF on the server (up to 10 MB per file). Drag-and-drop or browse, set quality 1–100 and optional max width in pixels (scales down only; default 1920). See before/after byte sizes when meta is returned, then download the compressed image.

imagecompress+5

Image Resize

New

Resize or reframe JPEG, PNG, WebP, or GIF entirely in your browser: set target width and height, optionally lock aspect ratio, then choose how pixels map—Fit (letterbox on white), Cover (center crop to fill), or Stretch. Export as JPEG, PNG, or WebP with a quality slider for lossy formats. Decoding and canvas work stay on your device (no upload). Animated GIFs flatten when exporting to static formats.

imageresize+1

Image Format Converter (JPG / PNG / WebP)

New

Convert JPEG, PNG, WebP, or GIF sources to JPEG, PNG, or WebP in your browser: live preview updates as you switch format, quality slider for lossy JPEG and WebP, lossless PNG (no quality control). Decoding and encoding stay on your device—no upload. GIF sources decode to a static frame; animation is not preserved in the output file.

imageconvert+1

Rotate & Flip Image

New

Rotate JPEG, PNG, WebP, or GIF photos in 90° steps (90°, 180°, −90°), flip horizontally or vertically, combine transforms, reset to original, and preview on canvas—all in your browser. Download keeps PNG/WebP as those types and uses JPEG for other extensions (including GIF sources). Live PNG preview; no upload. GIF animation is not preserved on export.

imagerotate+1

Add Text to Image

New

Overlay a single line of text on JPEG, PNG, WebP, or GIF photos entirely in your browser: edit the caption, font size (8–200px), fill color, horizontal and vertical position (0–100%), and optional dark stroke for contrast. Live preview; download as PNG, JPEG, or WebP with a quality slider for lossy formats. Canvas rendering stays local—no upload. GIF animation is not preserved when exporting.

imagetext+1

Image Background Remover

New

Cut out subjects in your browser with the IMG.LY ONNX + WASM segmentation model (ISNet quantized): first visit downloads WASM and model weights from their CDN (~tens of MB, then cached). Long edges above 2048px are scaled down before inference; max file size 8MB for stability. Export transparent PNG with checkerboard preview. Your pixels are not uploaded to Dynamic Duniya—only model assets load from the vendor CDN.

imagebackground+1