Number Base Converter
Binary, octal, decimal and hex, all at once.
How to use
- Pick the base of your input number (decimal, binary, octal, hex, or custom).
- Type the number into the input field.
- The value appears simultaneously in all standard bases.
- Open the custom-base panel to convert to any radix from 2 to 36.
- Copy any result with a single tap.
Frequently asked questions
What bases are supported?
Any base from 2 (binary) to 36, which is the largest base representable with digits 0-9 and letters A-Z. Common ones (2, 8, 10, 16) have their own quick-access fields.
Does it handle negative numbers and fractions?
Negative integers are supported across all bases. Fractional parts are supported for decimal and hex; for other bases, fractional support depends on the chosen precision.
How big can the numbers be?
The converter uses BigInt for integer conversions, so any size of whole number works. Fractional values are limited by JavaScript double precision, around 15-17 significant digits.
Why is hex sometimes written as 0x?
The 0x prefix is a C-language convention to mark a hexadecimal literal. The converter accepts it on input and never emits it on output.
Why programmers juggle four number bases
Binary is what hardware speaks: each digit is one transistor state. Hexadecimal exists because binary is unreadable at length; one hex digit packs exactly four bits, so the byte 11010100 becomes a tidy D4. That 4-to-1 mapping is why memory addresses, colour codes (#D4A373 is three bytes) and hash digests are written in hex. Octal groups bits in threes and survives mainly in Unix file permissions, where 755 means rwxr-xr-x. Decimal is for humans and almost nothing else.
Converting by hand, once, so the tool makes sense
To convert 156 to binary, repeatedly divide by 2 and read the remainders backwards: 156, 78, 39, 19, 9, 4, 2, 1 gives 10011100. To go from binary to hex, split into nibbles from the right: 1001 1100 is 9C. Doing this once on paper makes the relationships permanent; after that, let the converter do it.
Details that bite in real code
- Prefixes matter: 0x9C is hex, 0o234 is octal, 0b10011100 is binary. A leading zero alone meant octal in older languages and caused legendary bugs (010 == 8).
- Negative numbers in binary use two's complement in real systems. -1 in an 8-bit register is 11111111, not a minus sign.
- Letter case in hex is meaningless: 9c and 9C are identical values.
- Base 36 (digits plus the full alphabet) appears in URL shorteners and invoice codes because it packs large integers into short, case-insensitive strings.
Reading large binary quickly
Nobody reads long binary digit by digit. The trick is grouping: split from the right into nibbles of four and translate each to one hex digit (1111 is F, 1010 is A), or memorise the eight three-bit patterns for octal. Powers of two become recognisable landmarks... 1 followed by n zeros is 2^n, so 10000000 is 128 on sight. For mixed work, keep the byte boundaries in mind: 8 bits per byte means two hex digits per byte, which is why hex dumps come in tidy pairs and why a 32-bit value is always exactly eight hex characters. The same grouping skill reads IPv6 addresses (eight groups of four hex digits), Unicode code points (U+1F600 is just a hex number in costume), and the permission triplets behind chmod 644. Base fluency turns out to be less about converting numbers and more about recognising which base a value is speaking before doing arithmetic on it.
Advertisement