Alines Webマガジン

how to convert hex to rgb color manually hgysxwqXXM0

📅 November 2, 2026📖 Verified Publication
```html How to Convert Hex to RGB Color Manually – Complete Playbook

How to Convert Hex to RGB Color Manually: The Complete Playbook

Whether you are designing a website, editing an image, or working with CSS, knowing how to convert hex to RGB by hand is a practical skill that saves time and deepens your understanding of digital color. This guide walks you through every method—short and long hex notation, three-step and six-step conversion—with worked examples, a quick-reference table, and a ready-to-use checklist.

Key Takeaways

  • Hex codes use base-16 (digits 0–9 and letters A–F); RGB values use base-10 (0–255 for each channel).
  • Short hex (3-character) format like #F0A expands to #FF00AA before conversion.
  • Each hex pair maps directly to one RGB channel: Red = first two digits, Green = middle two, Blue = last two.
  • The conversion formula is simple: multiply the first hex digit by 16, add the second hex digit.
  • Memorizing the 16 hexadecimal-to-decimal values eliminates the need for a converter tool.

Understanding Hex and RGB Color Notation

What Is a Hex Color Code?

A hex color code is a six-digit (or three-digit shorthand) hexadecimal number preceded by a hash symbol (#). It represents the red, green, and blue components of a color in base-16 notation:

  • #RRGGBB — full six-character format
  • #RGB — compact three-character format (each digit is duplicated)

What Is an RGB Color Value?

RGB stands for Red, Green, and Blue. Each channel is expressed as a decimal integer from 0 to 255, giving a total of 16,777,216 possible colors:

  • R (Red) — first value (0–255)
  • G (Green) — second value (0–255)
  • B (Blue) — third value (0–255)

The functional form is written as rgb(R, G, B).

Hex-to-Decimal Reference Table

Before converting, memorize or keep handy this reference that maps every two-digit hex pair to its decimal equivalent:

Common Hex-to-Decimal Conversions
Hex Decimal Hex Decimal Hex Decimal
00010162032
01111172133
05515212537
0A101A262A42
0F151F312F47
101620323048
1F312F473F63
406450806096
7F127801289F159
AF175BF191CF207
DF223EF239FF255

Step-by-Step: Converting 6-Character Hex to RGB

Step 1 — Identify the Three Pairs

Given #RRGGBB, split the code into three two-digit groups:

  • Pair 1 (Red): digits 1–2
  • Pair 2 (Green): digits 3–4
  • Pair 3 (Blue): digits 5–6

Step 2 — Convert Each Pair Using the Formula

For each pair, apply:

Decimal = (First digit × 16) + Second digit

Remember the letter values: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.

Step 3 — Write the RGB Result

Combine the three decimal values into the format rgb(R, G, B).

Worked Example: Convert #2F8C1A

  • Red pair = 2F: (2 × 16) + 15 = 32 + 15 = 47
  • Green pair = 8C: (8 × 16) + 12 = 128 + 12 = 140
  • Blue pair = 1A: (1 × 16) + 10 = 16 + 10 = 26
  • Result: rgb(47, 140, 26)

Step-by-Step: Converting 3-Character (Short) Hex to RGB

Step 1 — Expand the Short Code

Duplicate each character to create the full six-digit code:

  • #RGB becomes #RRGGBB
  • Example: #F0A → #FF00AA

Step 2 — Convert as Usual

Apply the same formula to each expanded pair.

Worked Example: Convert #F0A

  • Expanded: #FF00AA
  • Red = FF: (15 × 16) + 15 = 240 + 15 = 255
  • Green = 00: (0 × 16) + 0 = 0
  • Blue = AA: (10 × 16) + 1