DevKitBase
ToolsAboutPrivacy

RGB to hex for tokens, design specs, and CSS variables

Enter R/G/B (0–255) or paste `rgb(14,165,233)`; get `#0ea5e9`.

chars: 10
Input
Output

When to use

Matching computed styles back to hex or logging a palette.

Examples

Input
4, 120, 87
Output
#047857
Input
255,255,255
Output
#ffffff

How it works

Clamp channels → two-digit hex; optional alpha.

Common pitfalls

  • Out-of-range channels get clamped.
  • Spaces and rgb() wrappers may need stripping.
  • HSL input isn’t RGB — convert elsewhere first.

How this differs

Inverse of Hex→RGB. Number Base Converter is for arbitrary bases, not colors.

FAQ

Percent RGB?
Convert or reject with guidance.
HSL?
Out of scope for this page.
Reverse?
Hex to RGB.
Uploaded?
No.

Related tools

Runs in your browser. Nothing is uploaded. Not a security product —hashes and JWT decode are for debugging, not password storage or auth advice.