We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Was this tool helpful to use?
Your feedback helps us make it better
Convert RGB and HEX color codes online. Get accurate color conversions for designers and developers.
Enter color value to start conversion
Overview
Understand what the tool solves, how it works, and the boundaries of its data.
This converter changes a color between an RGB value and a hexadecimal (HEX) value, and displays a color preview. RGB describes red, green, and blue channel values; a six-digit HEX code writes those three channel values in base 16, two digits per channel. For example, rgb(255, 0, 0) corresponds to #FF0000.
You can enter the RGB triplet with or without the rgb(…) wrapper, or enter a HEX color such as #FF0000. The opposite field updates from a valid value, and each text value has its own copy control. The output is opaque RGB/HEX; it does not preserve alpha transparency.
Each RGB channel is written as a two-digit hexadecimal number. For a red value of 255, the pair is FF; for green and blue values of 0, the pairs are 00 and 00. Put the three pairs in red, green, blue order after the hash mark to form #FF0000. The reverse conversion reads each pair back as one channel.
W3C’s CSS Color specification describes sRGB hexadecimal color notation and its channel components. The format has additional forms that can represent alpha, but this converter’s result is limited to an opaque six-digit code. See the CSS Color Module Level 4 (checked September 28, 2026).
Guide
Follow the workflow and verify inputs and outputs with practical examples.
Type a triplet such as 255, 0, 0 or rgb(255, 0, 0), or enter a HEX value such as #FF0000.
When the entry parses as a color, the paired field updates and the preview shows the resulting color.
Copy the RGB text for a workflow that expects channel notation, or copy the HEX text for a field that expects a hex code.
Use the clear control to remove both values and start with a blank preview.
Use cases
See how the tool fits into real work and everyday tasks.
When a design note gives RGB channels but a style field expects HEX, enter the three channel values and copy the six-digit result.
Use the preview to visually check a supplied code, then copy RGB or HEX in the format your teammate’s design tool requests.
If a reference lists one representation and a form requires the other, convert it and compare the preview before pasting the value into the final document.
Q&A
Find concise answers to common questions and confusing cases.
The converter updates the opposite representation only when the current input can be parsed as a color. Check for missing channel values, stray characters, or a malformed HEX value, then try a simple known value such as #FF0000.
For a valid RGB color in the supported opaque format, the HEX code is another notation for the same three channel values. It does not add color-profile information or preserve a separate alpha value.
The result described here is an opaque six-digit HEX value and does not keep alpha transparency. Preserve transparency separately or use a format that represents an alpha channel.
Notes
Review scope, result limitations, and important precautions before use.
An alpha channel controls transparency in color formats that include one. This page’s documented conversion is based on three RGB channels and an opaque six-digit HEX output, so transparency from an RGBA or alpha-bearing HEX color is not retained. If transparency matters, use a color field and format that explicitly supports alpha, and verify its channel order and notation.
A color preview is also a screen display, not a guarantee that two monitors, printers, or color-managed workflows will reproduce the same appearance. Use the copied channel/code values when you need to communicate the numeric color.
Related
Discover related tools, collections, and available API capabilities.