$ toolfu run hex-to-rgb
HEX to RGB Converter — Convert Hex Colors Online Free
Free online HEX to RGB converter. Convert hex color codes to RGB values with live preview. Get CSS, Swift, and Android code snippets — also converts RGB to hex.
all processing runs in your browser
hex-to-rgb
input > hex color
HEX
#3fb950
RGB
rgb(63, 185, 80)
CSS
rgb(63, 185, 80)
Swift
UIColor(red: 0.247, green: 0.725, blue: 0.314, alpha: 1.0)
Android
Color.rgb(63, 185, 80)
reverse: rgb(63, 185, 80) → #3fb950
HEX to RGB Color Converter — Convert Hex Colors Online
Designers work in hex, iOS developers need UIColor, Android uses Color.rgb, and CSS offers both formats. Converting between them manually means doing hex math or looking up values — this tool does it instantly.
Type or paste a hex color code and see the live color preview along with ready-to-use code snippets for multiple platforms. Each snippet has a copy button so you can paste directly into your project.
Supported output formats
- HEX — normalized lowercase with # prefix
- RGB — individual red, green, blue values (0-255)
- CSS — rgb() function notation
- Swift — UIColor initializer with CGFloat values
- Android — Color.rgb() call with integer values
$ cat FAQ.md
What hex formats are supported?▶
Both 3-digit shorthand (#RGB) and 6-digit (#RRGGBB) hex codes are supported. The leading # is optional. For example, #fff, fff, #ffffff, and ffffff all work.
What code snippets are generated?▶
The tool generates code for CSS (rgb() notation), Swift (UIColor), and Android (Color.rgb). Each snippet is ready to copy and paste into your codebase.
Can I convert RGB back to HEX?▶
Yes. The tool shows the reverse conversion at the bottom. The rgbToHex function clamps values to 0-255 and generates the corresponding hex code.
Does this support alpha/transparency?▶
This tool handles opaque RGB colors (6-digit hex). For RGBA/HSLA conversions with alpha channels, a full color picker tool would be more appropriate.