Free online tool

Number Base Converter

Type in any field and the others update. Great for debugging, embedded work, and CS homework.

Why do we need multiple number bases?

Humans count in base 10 because we have ten fingers, but computers count in base 2 because a transistor is either off or on. Hexadecimal (base 16) is a compact way to write binary — every four bits map to exactly one hex digit — so it dominates memory addresses, color codes, and hash strings. Octal (base 8) is the historic cousin, still used in Unix file permissions. Being fluent in all four is a genuinely useful superpower for developers, embedded engineers, and anyone poking at low-level formats.

How to read the conversions

Binary 11111111 equals decimal 255, hex FF, and octal 377. That's the range of a single unsigned byte, which is why the CSS color #FFFFFF is pure white — three bytes of maximum intensity. Once you internalize a few of these anchor values (0, 1, 15/F, 255/FF, 1024/400, 65535/FFFF), most day-to-day conversions become mental math you barely notice.

Practical uses

Debug a bitwise flag by pasting the decimal value and reading the binary. Convert a HEX color from a design file to RGB by splitting the hex into three pairs and looking up each pair's decimal value. Read a Unix permission like 0644 by converting the octal to binary and mapping each triplet to read/write/execute for owner, group, and world. All of that becomes friction-free with a converter you trust and can open in one tab.

+Does it handle negative numbers?

Yes — negative decimals convert with a leading minus sign. Two's complement bit patterns are not shown; use a dedicated tool if you need those.

+What's the maximum value?

Roughly 2^53 (about 9 quadrillion) — the safe integer range in JavaScript. For bigger numbers you need a BigInt-aware tool.

+Is the hex uppercase or lowercase?

Output is uppercase (matches how hex is written in most specs). You can lowercase it in your editor if a style guide requires it.

Moving numbers between binary, octal, decimal and hex

Computers only really understand binary, but humans find binary tedious to read, so hexadecimal and octal exist as compact shorthand — four binary digits map to exactly one hex digit, which is what makes hex so convenient for programmers.

Each base has its own niche depending on how naturally it groups with binary, and knowing why helps make sense of where you'll actually encounter each one.

Why hex lines up so neatly with binary

Since 16 is 2^4, every hexadecimal digit represents exactly four bits: binary 1010 1111 splits cleanly into A and F, giving hex AF. Octal works the same way with groups of three bits (since 8 = 2^3), so binary 101 110 becomes octal 56. Decimal has no such clean relationship to binary, which is exactly why it's awkward to convert by inspection and needs actual division-and-remainder arithmetic.

Two's complement and negative numbers

In an 8-bit signed system, negative numbers are represented by inverting all bits of the positive value and adding 1 — so -5 in 8-bit two's complement is 11111011, not just a binary 101 with a minus sign attached. This is why the same bit pattern can mean a small negative number or a large positive one depending on whether the system treats it as signed or unsigned, a frequent source of bugs when the bit width isn't specified.

Worked example

Decimal 202 converts to binary by repeated division: 202 = 128+64+8+2, giving 11001010. Grouped in fours that's 1100 1010, which is hex CA — and indeed 12x16 + 10 = 202, confirming the conversion.

Why octal used to matter more than it does now

Octal was widely used on older computer architectures with word sizes divisible by three bits, such as 12-bit and 36-bit minicomputers common in the 1960s and 70s, where it grouped memory addresses more naturally than hex would have. Once 8-bit bytes and 16/32/64-bit word sizes became standard, hex's four-bit grouping fit far better, and octal's use shrank mostly to Unix file permission notation, like chmod 755, which is one of the last places most people still encounter it.

Where each base shows up in practice

Hexadecimal dominates color codes in web design (#FF5733), memory addresses in debuggers, and MAC addresses on network hardware. Binary underlies bitmasks and flag fields in low-level programming. Decimal remains the default for anything user-facing, since almost nobody thinks in base 16 when reading a price or a phone number.

How the division-remainder method actually works

Converting decimal to any other base repeatedly divides by the target base and reads the remainders in reverse: converting 45 to binary means 45/2=22 r1, 22/2=11 r0, 11/2=5 r1, 5/2=2 r1, 2/2=1 r0, 1/2=0 r1, and reading the remainders bottom to top gives 101101. The same mechanical process works for any target base, just swapping the divisor, which is why a single algorithm underlies every base conversion this tool performs.

People also search for

  • binary to decimal converter
  • hex to decimal calculator
  • decimal to binary converter
  • number base converter online
  • octal to binary conversion
  • hexadecimal converter tool
  • two's complement calculator