What a base actually means

A base is how many symbols you have before you need a new column. In base 10 you run out after 9, so ten becomes 10. In base 2 you run out after 1. In base 16 you need six extra symbols beyond the digits, which is why A through F stand for ten through fifteen.

Every positional number is the same idea: each column is the base raised to its position. The decimal number 2023 means 2×10³ + 0×10² + 2×10¹ + 3×10⁰. Binary 1011 means 1×8 + 0×4 + 1×2 + 1×1 = 11. Nothing else is going on.

Converting decimal to another base: repeated division

Divide by the target base, write down the remainder, repeat with the quotient, then read the remainders bottom to top. Converting 2023 to hexadecimal:

StepDivisionQuotientRemainderDigit
12023 ÷ 1612677
2126 ÷ 16714E
37 ÷ 16077

Reading upward gives 0x7E7. Check it forward: 7×256 + 14×16 + 7 = 1792 + 224 + 7 = 2023.

The same number in the other common bases:

The shortcut nobody teaches early enough

You almost never need to go through decimal to move between binary, octal and hex, because 8 and 16 are both powers of 2. Just group the bits.

Binary to hex: group in fours from the right, padding the left with zeros. Our 11111100111 becomes 0111 1110 0111, which reads directly as 7 E 7. Each group of four bits — a nibble — is exactly one hex digit.

Binary to octal: group in threes instead. 11 111 100 111 becomes 3 7 4 7.

Once you can read the sixteen nibble patterns, hex conversion stops being arithmetic and becomes lookup. This is the whole reason hex exists.

Why hex, and not something more human

Hex is not chosen for elegance. It is chosen because one byte is exactly two hex digits. A byte holds eight bits, values 0 to 255, and writes as 00 to FF — always two characters, never more, never fewer. Binary would take eight characters per byte and be unreadable; decimal would take one to three characters and never line up in columns.

That is why hex turns up everywhere bytes matter: memory addresses, colour codes like #7E7ABC where each pair is one channel from 0 to 255, MAC addresses, hashes, character escapes such as \u00E9, and hex dumps of binary files. Octal is largely a historical survivor, kept alive mainly by Unix file permissions, where 755 is three groups of three permission bits.

Negative numbers work differently

Computers do not store a minus sign. They use two complement: invert every bit of the positive value and add one. In eight bits, 5 is 00000101, so −5 is 11111011, which as an unsigned number would read 251.

This matters because it means the same bit pattern has two valid readings depending on whether the type is signed. A byte of 0xFF is 255 unsigned and −1 signed. Converting a bit pattern to decimal without knowing the signedness of the source is guessing, and it is behind a whole family of off-by-a-huge-amount bugs.

Honest limits

This converter handles non-negative integers. Fractional values in binary are a separate topic with its own hazard — many decimal fractions have no exact binary representation, which is why 0.1 + 0.2 does not equal 0.3 in floating-point arithmetic. Very large values may exceed the precision your browser can hold exactly; for cryptographic-scale integers, use a big-integer library rather than a web page.

Questions people actually ask

Is base64 a number base?

No, despite the name. Base64 is a way to encode arbitrary bytes as text using 64 safe characters, so binary data survives channels that only accept text. It does not represent a numeric value the way base 16 does.

Why does 0x sometimes appear, and sometimes 0b?

They are prefixes marking the base for a human or a compiler: 0x for hex, 0b for binary, 0o for octal in modern languages. A bare leading zero used to mean octal in C, which caused enough confusion that newer languages require the explicit 0o.

How many bits do I need for a number?

The number of bits is the base-2 logarithm rounded up. For 2023 that is 11 bits, since 2¹⁰ is 1024 and 2¹¹ is 2048. In hex, each digit covers 4 bits, so 2023 needs three hex digits.

Does anything I type get uploaded?

No. The conversion runs in your browser and nothing is transmitted or stored.

Keep exploring Gen Code Tools

Every tool comes with a written guide, and every category is one click away.