How to Convert Hex to RGB
© Textile Calculator Ltd. 2010 –
Disclaimer: All calculators in the Textile Calculator have been reviewed by the relevant textile industry experts.
Formula for Hex to RGB Conversion
Formula:
To convert a HEX color code to RGB:
- Extract the red, green, and blue components:
- Red (R) = hex[1-2]
- Green (G) = hex[3-4]
- Blue (B) = hex[5-6]
- Convert each pair from hexadecimal to decimal using:
- R = parseInt(hex.slice(1, 3), 16)
- G = parseInt(hex.slice(3, 5), 16)
- B = parseInt(hex.slice(5, 7), 16)
Example:
HEX: #008080
R = 00
→ 0
G = 80
→ 128
B = 80
→ 128
RGB: rgb(0, 128, 128)
Table of Contents
As a textile engineer and fashion designer, I often work with digital design tools. These tools use color codes in both hex and RGB formats. In textile printing, embroidery, and digital fabric design, we use exact color matching systems. Understanding how to convert hex to RGB helps us create better designs for screens and fabrics.

What Is a Hex Color Code?
Hex stands for hexadecimal. A hex code starts with a hash (#) followed by six digits. Each pair represents red, green, and blue. These codes are often used in digital design software.
For example, the color code #008080
represents a teal color. The first two digits are red, the next two are green, and the last two are blue.
Why RGB Format Is Important in Textile Manufacturing
RGB stands for Red, Green, and Blue. These are the primary colors for screens. We use RGB values in design software, dyeing simulations, and fabric color previews. Textile printing machines and color software often support RGB more than hex.
When you convert hex to RGB, you can compare digital shades to Pantone codes or lab dye shades. This is useful when you match your digital pattern with the final fabric output.
Step-by-Step Guide to Convert Hex to RGB
Step 1: Take a Hex Code
Start with any 6-digit hex color code that begins with #
. Example: #FF5733
.
Step 2: Split the Code
Divide it into 3 parts:
- FF (Red)
- 57 (Green)
- 33 (Blue)
Step 3: Convert Each to Decimal
Use a calculator or software to convert each pair:
- FF = 255
- 57 = 87
- 33 = 51
Step 4: Combine Values
Put the decimal values together:
RGB = rgb(255, 87, 51)
You can use this RGB code in your textile design software like Adobe Illustrator, CorelDRAW, or embroidery digitizing programs.
Example Calculation:
Let’s take #008080
- Red =
00
→ Decimal = 0 - Green =
80
→ Decimal = 128 - Blue =
80
→ Decimal = 128
RGB = rgb(0, 128, 128)
This teal color is common in polyester design and sublimation printing.
Why It Matters for Textile Designers
Designers use hex codes for web and screen designs. But when we move to textile production, printers, fabric visualizers, and simulation software prefer RGB or CMYK. Converting hex to RGB bridges the gap between the design concept and the actual production.
For example, when a client sends a hex-based logo design, we must convert that to RGB before printing on cotton, polyester, or silk. It ensures better color matching across devices and fabrics.
Where You Can Use This in Real Work
Digital Fabric Printing
In digital printing, the printer reads RGB or CMYK codes. Converting hex to RGB helps in ink selection.
Embroidery Software
Embroidery machines often use RGB values for color threads. Hex codes must be converted before finalizing the stitch file.
Heat Transfer Vinyl (HTV)
When printing HTV or sublimation papers, RGB codes ensure the right shade reaches the vinyl sheet.
Use Our Free Hex to RGB Calculator
To make your work easier, we’ve added a calculator below. You can type a hex code and get the RGB value instantly. This tool is useful for textile students, professionals, and designers.
Try it with your client’s branding color, and get RGB values without manual conversion.
Pro Tips from a Textile Engineer
- Always double-check the color on fabric before mass printing.
- Convert hex to RGB first, then cross-match with Pantone shades.
- Use calibrated monitors while working with color design.
- Save a fabric swatch after each digital color print to use as a reference.
- Keep a record of RGB values in design sheets for future consistency.
Final Thoughts
Hex to RGB conversion is a basic step for every digital textile designer. This small action helps avoid big color mismatches. As a textile engineer, I recommend learning this to save time and cost. Use our calculator to speed up your work and avoid confusion in color output.
This method works well in screen printing, direct-to-garment printing, sublimation, and heat transfer vinyl applications. Keep using simple tools like this to bring precision to your textile work.