Base Calculator
Convert numbers between binary, octal, decimal, hexadecimal, and any base from 2 to 36
By Waqar Mushtaq · Last updated:
A number base (or radix) is the count of unique digits a numeral system uses before it carries over to the next place value. Everyday arithmetic uses base 10 (decimal), but computing relies heavily on base 2 (binary, the two states a transistor or memory cell can hold), base 8 (octal, an older shorthand for grouping binary digits), and base 16 (hexadecimal, used for memory addresses, color codes, and byte-level data because two hex digits map exactly to one byte). This base calculator converts a value in any base from 2 to 36 into binary, octal, decimal, and hexadecimal simultaneously, plus one custom base of your choosing, so you can move between representations without doing the arithmetic by hand.
How Base Conversion Works
O(n) in the number of digitsN = value · d_i = digit at position i (0-indexed from the right) · b = base · k = number of digits minus 1
Each digit in a number contributes its face value multiplied by the base raised to its position, counting from 0 at the rightmost digit. Converting into decimal means expanding that sum directly; converting out of decimal into another base means repeatedly dividing by the target base and reading the remainders from last to first.
Example — converting hexadecimal FF to decimal: FF (base 16) = (15 × 16¹) + (15 × 16⁰) = 240 + 15 = 255
Example — converting decimal 255 to binary: 255 ÷ 2 = 127 r 1 127 ÷ 2 = 63 r 1 63 ÷ 2 = 31 r 1 31 ÷ 2 = 15 r 1 15 ÷ 2 = 7 r 1 7 ÷ 2 = 3 r 1 3 ÷ 2 = 1 r 1 1 ÷ 2 = 0 r 1 Reading the remainders bottom to top: 11111111
A base can use any digit set up to 36 symbols (0-9 plus a-z) before running out of single-character digits, which is why base 36 is the practical ceiling for most base converters, including this one.
Use Cases
Reading Memory Addresses and Debug Output
Debuggers, disassemblers, and crash logs print addresses and register values in hexadecimal because it maps cleanly to bytes (2 hex digits = 1 byte = 8 bits). Convert a hex address to decimal to compare offsets, or to binary to inspect individual bits or flags.
Working with Bitwise Flags and Permissions
Unix file permissions (e.g. chmod 755), RGB color codes (#FF5733), and bitmask flags in low-level code are all easier to reason about once you can see their binary or octal expansion alongside the more familiar decimal or hex form.
Computer Science Coursework
Base conversion is a standard early topic in CS and digital logic courses. Use the binary place-value breakdown to check homework by hand, or to build intuition for how positional numeral systems generalize beyond base 10.
Networking and Subnetting
IPv4 subnet masks and CIDR calculations are easier to verify when you can see an octet's binary form next to its decimal value (e.g. confirming 255.255.255.0 is 11111111.11111111.11111111.00000000).
Frequently Asked Questions
What is a number base (radix)?
A base is how many unique digits a numeral system uses before it rolls over to a new place value. Base 10 (decimal) uses digits 0-9; base 2 (binary) uses only 0 and 1; base 16 (hexadecimal) uses 0-9 plus a-f (or A-F) to represent values 10-15 in a single digit.
Why does computing use binary, octal, and hexadecimal instead of just decimal?
Binary matches the two physical states (on/off) a transistor or memory cell can represent, so it's the native language of digital hardware. Octal and hexadecimal are shorthand for binary: since 8 = 2³ and 16 = 2⁴, each octal digit represents exactly 3 bits and each hex digit represents exactly 4 bits, making them far more compact to read and write than a long string of 1s and 0s.
What is the largest base this calculator supports, and why?
Base 36, because it uses every digit (0-9) and every letter of the Latin alphabet (a-z) as a single-character symbol -- 36 unique digits in total. Beyond base 36 there's no widely agreed-upon single-character digit set, so most base converters, including this one, cap out there.
Can this calculator handle very large numbers?
Yes. It uses arbitrary-precision integer arithmetic (BigInt) internally rather than standard floating-point numbers, so it won't lose precision on values larger than 2^53 - 1 (JavaScript's safe integer limit) the way a naive implementation would.
Does this calculator support negative numbers or fractions?
Negative integers are supported (prefix the value with a minus sign). Fractional values are not currently supported -- the calculator works with whole numbers only, which covers the vast majority of base-conversion use cases like memory addresses, color codes, and permission bits.
Methodology
The formula above is implemented as a standalone module covered by unit tests, so its worked examples are re-checked on every change to the site. It is verified against the authoritative sources listed below.
Maintained by Waqar Mushtaq. Spotted a result that looks wrong? Report it and it becomes a failing test.