Hex to RGB Converter
Convert hex color codes to RGB values with live color preview swatches.
Paste hex codes and get rgb(r, g, b) values back, with swatch previews so you can spot-check each color. Handles #RRGGBB, bare RRGGBB, and 3-char shorthand like #F0A — invalid lines get flagged instead of silently dropped. And everything runs in your browser. Nothing gets uploaded.
How to Use
Enter hex color codes in the left panel. Supports #RRGGBB, RRGGBB, #RGB, and RGB shorthand formats.
One color per line -- enter as many colors as you want for batch conversion.
Click Convert or leave Live mode enabled for instant results. The output shows rgb(r, g, b) format.
View color swatches below the output to visually verify each converted color.
Frequently Asked Questions
What hex color formats are supported?
The tool supports several hex color formats: 6-character (#RRGGBB or RRGGBB), 3-character shorthand (#RGB or RGB), and optionally with or without the # prefix. For 3-character shorthand, each digit is doubled -- for example, #F0A becomes #FF00AA. The conversion handles both uppercase and lowercase hex letters.
How does hex to RGB conversion work?
A hex color code represents red, green, and blue channels each as a 2-digit hexadecimal number (00-FF). The conversion parses each pair of hex digits and converts them to their decimal equivalent (0-255). For example, #FF5733 splits into FF (255 red), 57 (87 green), 33 (51 blue), giving rgb(255, 87, 51).
What is the difference between this and the Color Tools hex converter?
This utility-style converter focuses on batch text conversion -- paste many hex codes and get all RGB values at once as text output. The Color Tools hex to RGB converter at /color-tools/hex-to-rgb/ offers a more visual, interactive single-color experience with sliders, additional color space conversions, and a color picker. Both produce the same rgb() output.
Can I convert multiple colors at once?
Yes! Enter one hex color per line, and all colors will be converted simultaneously. The output preserves the same line ordering, and color preview swatches appear below the output for visual verification of each color.
What is the rgb() format used for?
The rgb(r, g, b) format is a standard CSS color notation used in web development. Each value ranges from 0 to 255, representing the intensity of red, green, and blue respectively. This format is supported by all modern browsers and is commonly used in CSS stylesheets, JavaScript, and design tools.