Skip to main content
🟢 Beginner

Hex to Decimal Converter — 0x30, 0xFF & Any Hex to Decimal

Convert hex to decimal instantly: 0x30 = 48, 0xFF = 255, 0x1A = 26. Enter any hex value with step-by-step explanation. Free hex ↔ decimal converter, no signup.

★★★★★ 4.8/5 · 📊 0 calculations · 🔒 Private & free

Understanding the Hexadecimal Number System

Hexadecimal (hex) is a base-16 number system that uses 16 distinct symbols: the digits 0–9 and the letters A–F (where A=10, B=11, C=12, D=13, E=14, F=15). Hex is widely used in computing as a human-friendly way to represent binary data, because every 4 binary digits (bits) correspond to exactly one hex digit — making hex a compact shorthand for binary.

Each position in a hex number represents a power of 16:

Position16³16²16¹16⁰
Value4,096256161

Hex to decimal conversion: Multiply each hex digit by its place value (power of 16) and sum the results.

Example: 2F4A₁₆ = 2×4096 + F(15)×256 + 4×16 + A(10)×1 = 8,192 + 3,840 + 64 + 10 = 10,106

Hex numbers are typically prefixed with 0x in programming (e.g., 0x2F4A), or followed by h in assembly language (e.g., 2F4Ah), to distinguish them from decimal numbers.

Quick Example: 0x30 to Decimal

One of the most commonly looked-up hex values is 0x30. To convert 0x30 to decimal: multiply 3 by 16 and add 0 — giving 48. So 0x30 = 48 in decimal.

Why does 0x30 come up so often? Because in ASCII encoding, 0x30 is the character '0' (the digit zero). The digits '0'–'9' map to 0x30–0x39 (48–57 decimal), which is why programmers frequently encounter this value when parsing text or working with character codes.

Step-by-step: 0x30 → decimal

Common Hex Values — Quick Conversion Reference

These are the hex values programmers and developers look up most often:

HexDecimalCommon Use
0x1016One hex "ten"; base of hexadecimal
0x1F31Max 5-bit value; bitmask for 5 bits
0x3048ASCII '0' — the digit zero character
0x4165ASCII 'A' — start of uppercase letters
0x6197ASCII 'a' — start of lowercase letters
0x64100Decimal 100 — useful for percentage checks
0x7F127Max 7-bit / max ASCII value
0x80128Min value with bit 7 set; -128 signed
0xFF255Max byte value; full color channel (RGB)
0x1002562⁸; first 3-digit hex number
0x1F4500HTTP 500 error; half of 0x3E8
0x3E81,0001K — one thousand
0xFFFF65,535Max 16-bit unsigned integer
0xFFFFFF16,777,215Max 24-bit value; max CSS hex color

Decimal to Hexadecimal Conversion

Converting from decimal to hexadecimal uses the same repeated-division method as binary conversion, but dividing by 16 instead of 2.

Method: Repeatedly divide by 16, recording the remainder at each step. Remainders 10–15 are written as A–F. Read remainders from bottom to top.

Example: Convert 1,500 to hex

Read bottom to top: 5DC₁₆

Verify: 5×256 + D(13)×16 + C(12)×1 = 1,280 + 208 + 12 = 1,500 ✓

Example: Convert 255 to hex (the maximum value of a byte)

Result: FF₁₆ — which is why 255 is represented as 0xFF in code and #FFFFFF (white) in CSS colors uses all three channels at max (255, 255, 255).

Quick mental conversion tip: For numbers under 256, split into the highest multiple of 16 (the first hex digit) and the remainder (second hex digit). 180 = 11×16 + 4 = B4₁₆. 200 = 12×16 + 8 = C8₁₆.

Hex Color Codes: Web and Design Applications

One of the most common everyday uses of hexadecimal is CSS and web color codes. Colors are specified as #RRGGBB, where RR, GG, and BB are two-digit hex values (00–FF) for red, green, and blue channels respectively.

Hex ColorR (decimal)G (decimal)B (decimal)Color Description
#000000000Black (all channels minimum)
#FFFFFF255255255White (all channels maximum)
#FF000025500Pure red
#00FF0002550Pure green (lime)
#0000FF00255Pure blue
#FF57332558751Vivid orange-red
#4A90D974144217Medium sky blue
#808080128128128Middle gray (50% of each)

Each channel (00–FF) provides 256 levels × 3 channels = 16,777,216 possible colors (16.7 million). The shorthand #RGB notation (e.g., #F5A) expands each digit to two identical digits: #FF55AA — used in CSS when both hex digits in a pair are identical.

Modern CSS also supports #RRGGBBAA (8 hex digits) for colors with transparency (alpha channel), where AA defines opacity from 00 (fully transparent) to FF (fully opaque). Example: #FF573380 = the orange-red at 50% opacity (80₁₆ = 128₁₀ ≈ 50%).

Hex in Programming and Computing

Hexadecimal appears throughout programming, hardware documentation, and computer science:

Memory addresses: RAM and processor addresses are expressed in hex. A 64-bit memory address might look like 0x7FFE0B4C3A20. Hex is used because it compactly represents the underlying binary, and 2 hex digits = exactly 1 byte — making address arithmetic intuitive.

Machine code and disassembly: CPU instructions are encoded as hex bytes. The x86 instruction MOV EAX, 0x42 compiles to hex bytes B8 42 00 00 00. Security researchers and low-level programmers read hex dumps to understand or reverse-engineer software.

ASCII character encoding: ASCII maps characters to numbers 0–127. In hex: 'A' = 0x41, 'a' = 0x61, space = 0x20, '0' = 0x30. The pattern is consistent — uppercase letters start at 0x41, lowercase at 0x61 (exactly 0x20 = 32 difference, which is why XOR-ing a letter with 0x20 toggles its case).

IPv6 addresses: 128-bit IPv6 addresses are written as 8 groups of 4 hex digits: 2001:0DB8:AC10:FE01:0000:0000:0000:0001. Each group represents 16 bits (4 hex digits × 4 bits each). IPv4 addresses can also be expressed in hex: 192.168.1.1 = 0xC0A80101.

Error codes: Windows stop codes ("Blue Screen of Death") are hex: 0x0000007E, 0xC0000005. UNIX errno codes, HTTP status codes in network packets, and BIOS POST codes all use hex. Recognizing common hex patterns helps troubleshoot system issues.

Binary, Octal, Decimal, Hex: The Complete Conversion Reference

The four number systems used in computing and how they relate:

DecimalBinaryOctalHex
0000000
1000111
2001022
4010044
81000108
10101012A
15111117F
160001 00002010
320010 00004020
640100 000010040
1281000 000020080
2551111 1111377FF
2560001 0000 0000400100
1,0240100 0000 00002,000400
65,5351111 1111 1111 1111177,777FFFF

Shortcuts for fast conversion:

Practical Hex Calculations and Tips

A few useful techniques for working with hex in practice:

Hex addition: Add column by column, carrying when the sum reaches 16. Example: 3A + 2F:

Checking divisibility in hex: A hex number is divisible by 16 if the last digit is 0 (same as divisibility by 10 in decimal). It's divisible by 2 if the last hex digit is even (0,2,4,6,8,A,C,E).

Hex in URLs and encoding: URLs encode special characters using percent-encoding: a space becomes %20 (0x20 = 32 = space in ASCII). The @ symbol = %40 (0x40 = 64 = '@' in ASCII). Knowing ASCII hex codes helps decode encoded URLs.

Hash functions output hex: MD5 produces 128-bit (32 hex chars) output. SHA-256 produces 256-bit (64 hex chars) output. Example SHA-256 hash: a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3 — always 64 hex characters regardless of input size. This is what you see when verifying file downloads against checksums.

Frequently Asked Questions

How do you convert hexadecimal to decimal?

Multiply each hex digit by 16 raised to its position power (starting from 0 on the right) and sum the results. Example: 1A3₁₆ = 1×256 + A(10)×16 + 3×1 = 256 + 160 + 3 = 419. Our calculator does this instantly for any hex value you enter.

How do you convert decimal to hexadecimal?

Repeatedly divide by 16 and record the remainder at each step. Remainders 10–15 are represented as A–F. Read remainders from last to first. Example: 255 ÷ 16 = 15 remainder 15(F); 15 ÷ 16 = 0 remainder 15(F) → 255 decimal = FF hex.

What are hexadecimal numbers used for?

Hex is used throughout computing: memory addresses (0x7FF0E2A0), web color codes (#FF5733), machine code and binary data, IPv6 network addresses, cryptographic hash outputs (MD5, SHA-256), ASCII character encoding, Unix file permissions, BIOS error codes, and any context where compact binary representation is needed.

Why does hex use letters A through F?

Hexadecimal is base-16, requiring 16 distinct symbols. The digits 0–9 cover the first 10 values. Letters A through F represent values 10–15 respectively. This convention was standardized in computing in the 1960s. The choice of uppercase vs lowercase (A-F vs a-f) varies by system; both are valid and represent the same values.

What is 0x30 in decimal?

0x30 in decimal is 48. To convert: 3×16 + 0×1 = 48 + 0 = 48. The value 0x30 is especially significant in ASCII encoding — it represents the character '0' (the digit zero). The full range of ASCII digit characters '0'–'9' spans 0x30–0x39 (48–57 decimal).

What is 0xFF in decimal?

0xFF = F×16 + F×1 = 15×16 + 15 = 240 + 15 = 255. This is the maximum value of an 8-bit byte (unsigned). It appears frequently in programming for bitmasks, maximum color channel values (RGB uses 0x00–0xFF per channel), and anywhere an 8-bit max value is needed.

How do I read hex color codes?

A hex color code like #4A90D9 is split into three pairs: 4A (red), 90 (green), D9 (blue). Convert each to decimal: 4A = 4×16+10 = 74; 90 = 9×16+0 = 144; D9 = 13×16+9 = 217. So #4A90D9 = rgb(74, 144, 217) — a medium sky blue. The higher the value (closer to FF/255), the more of that color component.

What is the difference between 0x prefix and # prefix in hex?

Both indicate hexadecimal numbers, but in different contexts. 0x (e.g., 0xFF, 0x1A3) is the standard prefix in programming languages (C, C++, Java, Python, JavaScript, etc.). # is used specifically for web/CSS colors (#FF5733). Some contexts use h suffix (assembly language), $ prefix (older systems), or no prefix (when context makes it clear).

How do you quickly convert between binary and hex?

Group the binary number into sets of 4 bits from right to left, then convert each group to a single hex digit. Since 4 bits = exactly one hex digit, no arithmetic is needed. Example: binary 1011 0100 1100₂ → group as 1011|0100|1100 → B|4|C → B4C₁₆. This works in reverse too: each hex digit expands to exactly 4 binary digits.

},{"@type":"Question","name":"How do you convert decimal to hexadecimal?","acceptedAnswer":{"@type":"Answer","text":"Repeatedly divide by 16 and record the remainder at each step. Remainders 10–15 are represented as A–F. Read remainders from last to first. Example: 255 ÷ 16 = 15 remainder 15(F); 15 ÷ 16 = 0 remainder 15(F) → 255 decimal = FF hex."}},{"@type":"Question","name":"What are hexadecimal numbers used for?","acceptedAnswer":{"@type":"Answer","text":"Hex is used throughout computing: memory addresses (0x7FF0E2A0), web color codes (#FF5733), machine code and binary data, IPv6 network addresses, cryptographic hash outputs (MD5, SHA-256), ASCII character encoding, Unix file permissions, BIOS error codes, and any context where compact binary representation is needed."}},{"@type":"Question","name":"Why does hex use letters A through F?","acceptedAnswer":{"@type":"Answer","text":"Hexadecimal is base-16, requiring 16 distinct symbols. The digits 0–9 cover the first 10 values. Letters A through F represent values 10–15 respectively. This convention was standardized in computing in the 1960s. The choice of uppercase vs lowercase (A-F vs a-f) varies by system; both are valid and represent the same values."}},{"@type":"Question","name":"What is 0x30 in decimal?","acceptedAnswer":{"@type":"Answer","text":"0x30 in decimal is 48. To convert: 3×16 + 0×1 = 48 + 0 = 48. The value 0x30 is especially significant in ASCII encoding — it represents the character '0' (the digit zero). The full range of ASCII digit characters '0'–'9' spans 0x30–0x39 (48–57 decimal)."}},{"@type":"Question","name":"What is 0xFF in decimal?","acceptedAnswer":{"@type":"Answer","text":"0xFF = F×16 + F×1 = 15×16 + 15 = 240 + 15 = 255. This is the maximum value of an 8-bit byte (unsigned). It appears frequently in programming for bitmasks, maximum color channel values (RGB uses 0x00–0xFF per channel), and anywhere an 8-bit max value is needed."}},{"@type":"Question","name":"How do I read hex color codes?","acceptedAnswer":{"@type":"Answer","text":"A hex color code like #4A90D9 is split into three pairs: 4A (red), 90 (green), D9 (blue). Convert each to decimal: 4A = 4×16+10 = 74; 90 = 9×16+0 = 144; D9 = 13×16+9 = 217. So #4A90D9 = rgb(74, 144, 217) — a medium sky blue. The higher the value (closer to FF/255), the more of that color component."}},{"@type":"Question","name":"What is the difference between 0x prefix and # prefix in hex?","acceptedAnswer":{"@type":"Answer","text":"Both indicate hexadecimal numbers, but in different contexts. 0x (e.g., 0xFF, 0x1A3) is the standard prefix in programming languages (C, C++, Java, Python, JavaScript, etc.). # is used specifically for web/CSS colors (#FF5733). Some contexts use h suffix (assembly language), $ prefix (older systems), or no prefix (when context makes it clear)."}},{"@type":"Question","name":"How do you quickly convert between binary and hex?","acceptedAnswer":{"@type":"Answer","text":"Group the binary number into sets of 4 bits from right to left, then convert each group to a single hex digit. Since 4 bits = exactly one hex digit, no arithmetic is needed. Example: binary 1011 0100 1100₂ → group as 1011|0100|1100 → B|4|C → B4C₁₆. This works in reverse too: each hex digit expands to exactly 4 binary digits."}}]}