RGB to HEX Converter

Convert red, green and blue channel values into CSS-friendly HEX color output.

Result

#0F766E

RGB to HEX conversion runs locally in your browser.

All conversion happens locally in your browser. The value you enter is not sent to a server, logged, stored, or transmitted.

How to use this tool

Enter the required values in the labeled fields. Results update in your browser and are announced for assistive technologies. Use realistic measurements and verify important outcomes before acting on them.

Formula or logic

Each RGB channel is validated from 0 to 255. Optional alpha from 0 to 1 can produce 8-digit HEX.

Example calculation

Example: RGB 15, 118, 110 becomes #0F766E.

Practical use and limits

This page is built for quick unit conversion checks where the calculation should be transparent and repeatable. The calculation is intentionally visible and described above so you can sanity-check the result instead of treating it as a black box.

Limit: rounding, source-unit assumptions and business-critical tolerances should still be verified. For important decisions, use this result as a planning aid and verify it against the relevant source of truth.

Last reviewed: May 29, 2026.

RGB to HEX Converter: practical guide

RGB and HEX are two ways to describe the same screen color. Designers often think in swatches; developers often need the exact value for CSS or tokens.

Use the converter when moving colors between design tools, browser inspectors, docs and code.

Real examples

Dark neutral

Input: RGB 17, 24, 39

Result: #111827

Brand teal

Input: RGB 15, 118, 110

Result: #0f766e

Practical notes

  • HEX is compact for CSS.
  • RGB is easier to adjust channel by channel.
  • Check contrast before using a color for text.

Common mistakes

  • Forgetting the # in CSS contexts.
  • Mixing RGB order with BGR exports.
  • Choosing color without accessibility contrast.

Frequently asked questions

What range is valid for RGB?

Each RGB channel must be between 0 and 255.

Can alpha be included?

Yes. Alpha from 0 to 1 can be included.

Related tools

Converters

Color Converter

Convert HEX colors to RGB, RGBA, HSL and HSLA formats locally.

Design Tools

Contrast Checker

Check foreground and background colors against WCAG contrast rules.