the IT Hustle
도구실전 매뉴얼소개
FundamentalsAI 활용2026-04-17•9 min 읽기

Hex to Decimal: Number Systems Explained Simply

작성: Salty Deprecated Software Engineer

✨ AI 보조 콘텐츠

이 글은 AI 지원을 받아 작성되었으며, 정확성과 품질을 위해 팀이 검토했습니다. 모든 기술 정보와 예시는 검증되었습니다.

You've seen hex color codes in CSS. You've seen 0xFF in low-level code. You've seen binary in networking documentation. These aren't different languages — they're different ways of writing the same numbers. Once that clicks, everything gets easier.

This guide explains the four number bases you'll encounter in computing: binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). No math degree required.

Why Computers Don't Use Decimal

Humans evolved using base 10 because we have 10 fingers. Computers use base 2 because transistors have two states: on and off. Every number your computer stores is ultimately a sequence of ones and zeros.

Binary (base 2). Uses digits 0 and 1. Every modern computer works in binary at the hardware level.
Octal (base 8). Uses digits 0–7. Appears in Unix file permissions (chmod 755) and older systems.
Decimal (base 10). Uses digits 0–9. The base humans use. What you see in most UIs.
Hexadecimal (base 16). Uses digits 0–9 and letters A–F. Shorthand for binary — one hex digit = four binary bits.

The number 255 is the same number in all four systems — it's just written as 11111111 in binary, 377 in octal, 255 in decimal, and FF in hex.

How Decimal Works (The Model for Everything)

In decimal, each digit position represents a power of 10:

The number 347:

3 × 10² = 3 × 100 = 300

4 × 10¹ = 4 × 10 = 40

7 × 10⁰ = 7 × 1 = 7

Total: 347

Every other number system works the same way — just with a different base instead of 10. Binary uses powers of 2. Hex uses powers of 16. Once you internalize this, converting between bases becomes mechanical.

Binary: The Foundation

Binary uses only 0 and 1. Each digit position is a power of 2:

Binary 1011 to decimal:

1 × 2³ = 1 × 8 = 8

0 × 2² = 0 × 4 = 0

1 × 2¹ = 1 × 2 = 2

1 × 2⁰ = 1 × 1 = 1

Total: 8 + 0 + 2 + 1 = 11

To convert decimal to binary, repeatedly divide by 2 and track the remainders:

Decimal 13 to binary:

13 ÷ 2 = 6 remainder 1 ← least significant bit

6 ÷ 2 = 3 remainder 0

3 ÷ 2 = 1 remainder 1

1 ÷ 2 = 0 remainder 1 ← most significant bit

Read remainders bottom-up: 1101

Key binary reference points every developer should know: 8 bits = 1 byte, max value 255 (11111111). 16 bits = max 65,535. 32 bits = max ~4.3 billion.

Hexadecimal: Binary's Readable Sibling

Binary is unwieldy. The number 255 in binary is eight digits: 11111111. Hex condenses it to two: FF. That's why hex is used everywhere binary is used — it's human-readable shorthand.

Hex uses 16 symbols: 0–9 and A–F (A=10, B=11, C=12, D=13, E=14, F=15).

Hex to decimal reference:

0–9 → 0–9 (same as decimal)

A → 10

B → 11

C → 12

D → 13

E → 14

F → 15

10 → 16

FF → 255

100 → 256

To convert hex to decimal, use powers of 16:

Hex 2A to decimal:

2 × 16¹ = 2 × 16 = 32

A × 16⁰ = 10 × 1 = 10

Total: 32 + 10 = 42

Where You'll Actually See Each Base

Hexadecimal in the wild:
  • CSS colors: #FF5733 (R=255, G=87, B=51)
  • Memory addresses: 0x7fff5fbff8e0
  • Unicode code points: U+1F600 (😀)
  • SHA hashes and UUIDs
  • MAC addresses: 00:1A:2B:3C:4D:5E
Binary in the wild:
  • Network subnet masks: 11111111.11111111.11111111.00000000
  • Bitwise operations in code
  • Flags and permission bitmasks
Octal in the wild:
  • Unix file permissions: chmod 755 (rwxr-xr-x)
  • Legacy C/C++ integer literals: int x = 0777;

The Hex-Binary Shortcut

One hex digit always equals exactly four binary bits (a nibble). This makes converting between hex and binary trivial:

Hex to binary — convert each digit independently:

F = 15 = 1111

A = 10 = 1010

3 = 3 = 0011

FA3 in binary = 1111 1010 0011

This is why programmers use hex — it's direct shorthand for binary without the verbosity.

Converting in Code

You almost never convert by hand in practice. Every programming language has built-in functions:

JavaScript / TypeScript:

parseInt("FF", 16) // hex to decimal → 255

parseInt("1011", 2) // binary to decimal → 11

parseInt("377", 8) // octal to decimal → 255

(255).toString(16) // decimal to hex → "ff"

(255).toString(2) // decimal to binary → "11111111"

(255).toString(8) // decimal to octal → "377"

Python:

int("FF", 16) # hex to decimal → 255

int("1011", 2) # binary to decimal → 11

hex(255) # decimal to hex → "0xff"

bin(255) # decimal to binary → "0b11111111"

oct(255) # decimal to octal → "0o377"

CSS Colors: A Practical Hex Exercise

CSS hex colors are three pairs of hex digits — one pair each for red, green, and blue:

#FF5733 decoded:

FF = 255 → Red at full intensity

57 = 87 → Green at 34%

33 = 51 → Blue at 20%

The shorthand #F00 expands to #FF0000 — pure red. The 3-digit form works when both digits in each pair are identical.

Try it yourself

Use our free Number Base Converter to convert between decimal, binary, octal, and hexadecimal instantly — paste any number in any base and see all the equivalents.

Quick Reference Table

DecimalBinaryOctalHex
0000
1111
21022
410044
81000108
10101012A
15111117F
16100002010
321000004020
64100000010040
1281000000020080
25511111111377FF
256100000000400100

The One Thing to Remember

Different bases are just different notations for the same underlying number. 255 = 0xFF = 0b11111111 = 0o377. They're identical values written in different scripts.

You don't need to master hand conversion. You do need to recognize hex when you see it, understand that CSS color #00FF88 is three bytes, and know that chmod 755 is octal. The rest is Google and parseInt().

IT
Salty Deprecated Software Engineer

The IT Hustle의 편집용 필명으로 씁니다 — 노트북 수리 기사, 시스템 관리자, 스토리지 엔지니어, 소프트웨어 엔지니어로 일한 25년 이상의 경력을 이제 AI 에이전트 운영에 쏟고 있습니다. 모든 글은 게시 전에 사람이 검토합니다. 자세한 내용은 편집 원칙을 참고하세요.

도구 보기전체 아티클소개

새 소식 받기

새로운 도구, 블로그 포스트, 업데이트 소식을 가장 먼저 받아보세요. 스팸 없음.

나만의 반환각 프롬프트 생성하기

AI 프롬프트 엔진은 독자적인 기술로 내장 검증 및 모순 테스트가 포함된 프롬프트를 생성합니다.

무료 3회 생성 체험 →

회사

  • 소개
  • 실전 매뉴얼
  • AI 용어집
  • 필자 소개
  • 문의

제품

  • 도구
  • AI 가격 동향
  • 에이전트 옵스
  • 코드
  • 디자인
  • 시스템 관리
  • 생산성
  • 마케팅
  • 비즈니스

법적 고지

  • 개인정보 처리방침
  • 이용약관
  • 면책 조항
  • 편집 원칙
  • 정정 안내

© 2026 Salty Rantz LLC. 모든 권리 보유.

기술 변혁 속에서 일하는 사람들을 위해 만들었습니다.