PureDevTools

Hex to Decimal Converter

Convert hexadecimal to decimal, binary, and octal — bidirectional, supports 0x

All processing happens in your browser. No data is sent to any server.

Hex → Decimal / Binary / Octal

Decimal

DEC255

Binary

BIN11111111

Octal

OCT377

Decimal → Hex (bidirectional)

Hexadecimal

HEX

Binary

BIN

Octal

OCT
Hex digit reference ▸
HexDecimalBinaryOctal
0000000
1100011
A10101012
B11101113
C12110014
D13110115
E14111016
F15111117
FF25511111111377
10004096100000000000010000

Hexadecimal appears everywhere in development: HTML color codes, memory addresses, byte values in network packets, hash outputs, Unicode codepoints. The hex system exists because it maps cleanly to binary — 2 hex digits = 1 byte — and compresses long binary strings into something humans can actually read. This converter translates between hex and decimal (plus binary and octal) instantly.

What Is Hexadecimal (Base 16)?

Hexadecimal is a base-16 positional numeral system. It uses 16 symbols: 0–9 for values 0–9, and A–F (or a–f) for values 10–15.

HexDecimalBinary
0–90–90000–1001
A101010
B111011
C121100
D131101
E141110
F151111

The 0x prefix (e.g., 0xFF) is a programming convention indicating a hexadecimal literal. This tool accepts both FF and 0xFF.

How Hex to Decimal Conversion Works

Multiply each hex digit by its positional power of 16 and sum.

Example: 1A3 → decimal

1A3 = 1×16² + 10×16¹ + 3×16⁰
    = 256 + 160 + 3 = 419

Example: FF → decimal

FF = 15×16¹ + 15×16⁰ = 240 + 15 = 255

0xFF is the maximum value of a single byte — which is why you see it constantly in color codes, bitmasks, and byte-level operations.

Why Hex Maps Perfectly to Binary

One hex digit = exactly 4 bits (a nibble). Two hex digits = exactly 1 byte (8 bits). This isn’t coincidence — 16 = 2⁴, so every possible hex digit maps to a unique 4-bit pattern.

0xFF = 1111 1111 (all bits set, 255 decimal)
0x0F = 0000 1111 (low nibble only, 15 decimal)
0xF0 = 1111 0000 (high nibble only, 240 decimal)

This is why developers use hex instead of decimal for bitmasks: value & 0xFF (extract low byte) is immediately readable as a bit operation; value & 255 is not.

Real-World Hex Values You’ll Encounter

HTML/CSS Colors

CSS hex colors are three bytes — red, green, blue:

Shorthand #FFF = #FFFFFF because each digit is doubled.

Memory Addresses (x86-64)

64-bit pointers are written as 16 hex digits: 0x00007FFD4B2A1C30. The 0x prefix signals to readers that this is a hexadecimal memory address, not a decimal number.

Unicode Codepoints

Characters are identified by hex codepoints:

Status Codes and Flags

HTTP status 404 = 0x194. Error codes in Windows are hexadecimal: 0xC0000005 (access violation), 0x80070057 (invalid parameter).

Converting Decimal to Hex

To convert decimal to hex, repeatedly divide by 16 and record remainders:

419 ÷ 16 = 26 remainder 3   → 3
26 ÷ 16  = 1 remainder 10   → A
1 ÷ 16   = 0 remainder 1    → 1

Read remainders bottom to top: 1A3

Or just use the tool above — the “Decimal → Hex” panel does this instantly.

Frequently Asked Questions

What does 0x mean in front of a number? It’s a programming prefix indicating the following digits are in base 16 (hexadecimal). Originating from C, it’s now used in virtually every programming language. 0xFF = 255 decimal.

Is hex case-sensitive? No. 0xFF and 0XFF and FF and ff all represent the same value. Uppercase is conventional for standalone values; lowercase is common in CSS color codes.

Why are hex numbers often 2, 4, or 8 digits long? Because 2 hex digits = 1 byte, 4 hex digits = 2 bytes (16-bit word), 8 hex digits = 4 bytes (32-bit word). Padding to even digit counts makes the byte boundaries immediately visible.

Privacy

All conversions run entirely in your browser. No data is transmitted to any server.

Related Tools

More Encoding & Crypto Tools