Calcoid

Hex to Decimal Converter

Convert hexadecimal to decimal (and back) with optional 0x prefix and uppercase or lowercase output. Also surfaces the binary and octal equivalents and a per-digit positional breakdown.

Convert between hex and decimal

Digits 0-9 and A-F. The optional 0x prefix is accepted.

Hexadecimal (base 16)

0xFF

Decimal (base 10)

255

Binary (base 2)

0b11111111

Octal (base 8)

0o377

Bit length: 8 binary digits

Positional breakdown

Every hex digit contributes digit value times a power of 16.

  • F at position 1F x 16^1 = 240
  • F at position 0F x 16^0 = 15
  • Total255

Frequently Asked Questions about the Hex to Decimal Converter

Why is hex used so much in computing?
Because hex is the most compact notation that lines up cleanly with binary. Every hex digit covers exactly four binary bits (since 2^4 = 16), so two hex digits represent one 8-bit byte and four digits cover a 16-bit word. A 32-bit register is eight hex digits long instead of thirty-two binary digits, which is much easier to read and proofread. Decimal does not share that clean mapping with binary, so any time you need to see bit patterns (memory addresses, color channels, status flags, machine code) hex is the natural display format.
Where do I see hex in real life?
In four places that come up daily for developers and designers. Memory addresses (debuggers and stack traces print pointers as 0x7ffeefbff5c8). CSS and design colors (#FF5733 is three byte-sized channels for red, green, and blue). MAC addresses (00:1A:2B:3C:4D:5E uses six hex bytes to identify a network interface). And source code: C, C++, Java, JavaScript, Python, Rust, and Go all use the 0x prefix to write integer literals in hex (0xFF, 0xDEADBEEF), which is faster to type and read than the equivalent decimal when the value is meant to be a bit pattern.
How do I read a hex digit like A or F?
Hex needs sixteen distinct digits, so after 0-9 it borrows the first six letters: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15. From there it works exactly like decimal, only each position is worth a power of 16 instead of a power of 10. The digit F in the rightmost position is 15. The same F one place left is 15 x 16 = 240. So FF = 15 x 16 + 15 = 255, which is the largest value a single byte (eight bits) can hold.
What does the 0x prefix mean and do I have to write it?
The 0x prefix tells a parser that the following digits are hexadecimal. For example, 0xFF means 255 in decimal. Outside source code, context often makes the base clear, so color values, MAC addresses, and hash digests usually omit the prefix. This converter accepts input with or without 0x.
Is hex case-sensitive? Should I write FF or ff?
The value is identical: FF, Ff, fF, and ff all mean 255. The convention is mostly stylistic. Uppercase A-F is more common in low-level contexts like assembly listings, hex dumps, debuggers, and most C-family code (and is what RFC 4648 recommends for the standard base-16 encoding). Lowercase a-f is the norm in CSS colors (#ff5733), URLs, and many hash representations. The converter accepts either case on input and lets you pick the case for the output so you can match the style guide of whatever you are pasting into.

Related Calculators

More calculators in "Math"

See all 202 calculators in "Math"