Number Base Converter

Convert between binary, octal, decimal, hex and any base from 2 to 36.

Custom base

What a number base is

A base is how many distinct digits a counting system uses before it rolls over to the next place. Decimal uses ten digits, so after 9 comes 10. Binary uses two, so after 1 comes 10. The underlying quantity is identical in every base — only the notation changes.

This matters because computers work in binary, humans work in decimal, and hexadecimal exists as a convenient bridge between the two.

Binary

Binary uses only 0 and 1, mapping directly onto the two states an electronic switch can hold. Every value inside a computer is ultimately binary, which is why memory sizes, network masks and file permissions all become clearer once you can read it.

Binary is verbose — the decimal number 255 needs eight binary digits — which is precisely the problem hexadecimal solves.

Hexadecimal

Hex uses sixteen digits, adding A through F for the values ten to fifteen. Its usefulness comes from a clean mathematical relationship: one hex digit represents exactly four binary digits, so two hex digits represent exactly one byte.

That correspondence is why hex appears everywhere in computing. Colour codes in CSS are three bytes written as six hex digits. Memory addresses, MAC addresses, and cryptographic hashes are all hex. Converting between hex and binary requires no arithmetic at all — you substitute each digit for its four-bit pattern.

Octal

Octal uses eight digits and maps to exactly three binary digits. Its main surviving use is Unix file permissions, where the familiar 755 or 644 encodes read, write and execute bits for owner, group and others as three octal digits.

Common conventions

Prefixes distinguish bases in code. A leading 0x indicates hexadecimal, 0b indicates binary, and 0o indicates octal in most modern languages. A bare leading zero meant octal in older C-family languages, which caused genuine bugs when people wrote leading zeros for alignment.

Base 36 and beyond

Base 36 uses all ten digits plus all twenty-six letters, making it the densest representation using only alphanumeric characters. It appears in URL shorteners and short identifiers, where fitting a large number into few characters matters.

Why this is worth understanding

Reading hex lets you interpret colour codes, spot patterns in memory dumps, and understand error codes. Reading binary makes subnet masks, bitwise flags and permission bits obvious rather than mysterious. Neither requires memorising anything beyond the digit values.

Converted locally

All conversion happens in your browser with nothing transmitted.

Frequently Asked Questions

Why does computing use hexadecimal so much?

One hex digit maps to exactly four binary digits, so two hex digits are exactly one byte. It represents binary compactly with no arithmetic needed to convert.

What do the 0x and 0b prefixes mean?

0x indicates hexadecimal and 0b indicates binary. Modern languages use 0o for octal; a bare leading zero meant octal in older C-family languages.

Where is octal still used?

Mainly Unix file permissions, where values like 755 encode read, write and execute bits as three octal digits.

What is the highest base supported?

Base 36, which uses all ten digits plus all twenty-six letters — the densest alphanumeric representation.

Does the value change between bases?

No. Only the notation changes; the underlying quantity is identical.