Number Base Converter Calculator
Convert between any bases.
Formula
Convert via decimal
Example
1010 base2 → A base16.
Embed this calculator on your site
Add this free calculator to your own website with one line of code. The embedded version is responsive, ad-free, and includes a small attribution link back to CalcNest AI.
<iframe src="https://calcnestai.com/embed/number-base-converter-calculator.html" width="100%" height="700" frameborder="0" style="border: 1px solid #e5e5e5; border-radius: 12px; max-width: 720px;" loading="lazy" title="Number Base Converter Calculator — Free Tool by CalcNest AI"></iframe>
Understanding the Number Base Converter Calculator
A base converter translates a number between any bases from 2 to 36. The upper limit is set by the alphabet: ten digits plus twenty-six letters gives thirty-six symbols, and beyond that there is no conventional notation.
How it actually works
Enter a number, its current base, and the target base. The calculator parses the input in the source base and re-expresses it in the target. The value 255 in base 10 becomes 11111111 in base 2.
| Base | Where |
|---|---|
| 2 | Digital logic and computing |
| 8 | Unix file permissions |
| 16 | Memory, colours, hashes |
| 60 | Time and angles, from Babylon |
The deeper context most people miss
Base 60 survives in minutes, seconds, and degrees because 60 has an unusual number of divisors, so common fractions come out whole. That divisibility argument is the same reason 12 and 360 persist, and it is why a decimal clock never displaced the Babylonian one.
Why the choice of base has consequences
A positional system works in any base, and the choice determines which fractions terminate. A fraction expressed in base b terminates precisely when its denominator's prime factors all divide b. Base 10 has factors 2 and 5, so halves, quarters, fifths, and eighths terminate while thirds repeat. Base 2 has only the factor 2, so one tenth repeats forever in binary, which is the root cause of floating point surprises in every programming language. Base 12 would have factors 2 and 3, making thirds and quarters terminate, which is the substance of the dozenal advocacy that has persisted for centuries: twelve divides evenly by more small numbers than ten does, and the imperial measurement system and the clock both reflect that convenience. Base 60 does better still, with factors 2, 3, and 5, which is why Babylonian mathematicians used it and why sixtieths persist in timekeeping and angular measurement four thousand years later. Against these, base 10 has the advantage of matching finger counting and of being entrenched beyond any possibility of change. The practical lesson is that a repeating expansion is a property of the number and base together rather than of the number alone, so a value that looks awkward in one base can be exact in another.
A worked example: why 255 is 11111111
The value 255 in binary is eight ones, because it is one less than 256, which is two to the eighth. Numbers one less than a power of the base are always all-ones in that base, which is why 255, 65535, and 4294967295 recur throughout computing as the maximum values of 8, 16, and 32 bit unsigned integers. Recognising those figures as all-ones patterns rather than arbitrary constants makes a great deal of low-level code legible: a bitmask of 255 selects one byte, and 4294967295 appearing in output usually means an unsigned representation of minus one rather than a genuinely enormous count. The same pattern in hexadecimal gives FF, FFFF, and FFFFFFFF. Conversion between binary, octal, and hexadecimal is purely mechanical because 8 and 16 are powers of 2: three binary digits make one octal digit and four make one hexadecimal digit, so grouping the bits converts without arithmetic. That is the entire reason those bases are used rather than any base convenient in itself. Conversion to and from base 10 does require arithmetic, by repeated division taking remainders in reverse for one direction and by positional expansion for the other.
Deciding when base conversion matters practically
Reading memory dumps and network captures requires hexadecimal fluency, where knowing that a byte is two hex digits and recognising ASCII ranges makes raw data legible. Bitwise operations require thinking in binary, appearing in flags, permissions, masks, and low-level optimisation, with shifting being multiplication or division by powers of two. Unix file permissions use octal, where each digit encodes three bits of read, write, and execute, making 755 systematic rather than memorised. Subnet masks and CIDR notation only make sense in binary, since the boundaries fall at bit positions rather than decimal ones. Colour codes are hexadecimal. Character encodings specify code points in hex. Hashes and checksums are conventionally hex. Base 64 encodes binary as printable characters for transport and expands data by about a third rather than compressing it, which is a persistent misunderstanding. Base 58 excludes visually ambiguous characters and is used in cryptocurrency addresses to reduce transcription errors. In each case the base is chosen for a specific practical reason, and knowing the reason makes the convention memorable rather than arbitrary.
Positional notation and what it replaced
The positional system where a digit's value depends on its place is not obvious and was not universal. Roman numerals are additive and subtractive without positions, which makes arithmetic awkward: multiplying with them requires either an abacus or considerable ingenuity, which is why calculation in medieval Europe was a specialist skill. The decimal positional system with a symbol for zero developed in India by around the sixth century, reached the Islamic world where al-Khwarizmi described it, and entered Europe through Fibonacci's Liber Abaci in 1202. Adoption took centuries and met resistance, with some Italian cities banning the new numerals in commercial records on grounds that they were easier to alter than Roman ones, which was a legitimate concern given that a zero can be modified more readily than a word. The crucial innovation was zero as a placeholder rather than merely as a concept of nothing, since without it there is no way to distinguish 105 from 15 in a positional system. Babylonian base 60 lacked a placeholder for centuries and relied on context, which introduced genuine ambiguity into their records. The system that eventually won made arithmetic accessible to anyone rather than to specialists, and that democratisation of calculation was arguably as consequential as any single mathematical result.
Variations: notation, encodings, and unusual bases
Prefixes distinguish bases in most programming languages, with 0x for hexadecimal, 0b for binary, and 0o or a bare leading zero for octal, and the bare leading zero convention has caused real bugs where a value like 010 was meant as ten and read as eight. Digit grouping with underscores improves readability of long literals in several modern languages. Base 64 and base 32 encode binary data as printable characters. Base 58 omits ambiguous characters. Balanced ternary uses digits of minus one, zero, and one and has elegant properties including no separate sign. Negative bases and complex bases exist as curiosities. Non-integer bases including the golden ratio base have surprising properties. Roman numerals are non-positional. Tally systems are unary. For fractions, positional notation extends past the point with negative powers of the base, and repeating expansions follow the divisibility rule described. For very large numbers, positional notation itself becomes inadequate and specialised notations are needed, which is where up-arrow and similar notations come in.
Converting between bases
Convert to decimal by positional expansion, multiplying each digit by the base raised to its position, and from decimal by repeated division taking remainders in reverse. Group bits rather than converting arithmetically between binary, octal, and hexadecimal, since three bits make an octal digit and four make a hexadecimal one. Recognise all-ones patterns such as 255, 65535, and 4294967295 as one less than a power of two, which makes low-level code far more legible. Note that a fraction terminates in a base precisely when its denominator's prime factors all divide that base, which is why one tenth repeats in binary. Use explicit prefixes in code and beware a bare leading zero, which means octal in several languages. Remember base 64 expands data by about a third rather than compressing it. Check the base limit of any converter, since 36 is the conventional maximum given ten digits and twenty-six letters. And read Unix permissions as three octal digits of three bits each, which makes them systematic.
What people get wrong
- Assuming base 64 compresses data, when it encodes binary as printable characters for transport and expands the size by roughly a third.
- Writing a leading zero before a decimal literal, which several languages interpret as octal so that 010 becomes eight rather than ten.
- Expecting a fraction that terminates in decimal to terminate in binary, when one tenth repeats forever in base 2 and is the source of floating point surprises.
- Converting between binary and hexadecimal arithmetically, when grouping four bits per hex digit is purely mechanical and needs no calculation at all.
Where the math comes from
A positional numeral represents a value as the sum of each digit multiplied by the base raised to its position. Converting from decimal uses repeated division by the target base, collecting remainders in reverse order. Bases up to 36 use the ten digits followed by twenty-six letters, which sets the conventional upper limit.
Questions and answers
Why use hex instead of decimal?
Hex aligns with bytes - two hex digits = one byte. This makes binary data easier to read and write than decimal.
What is the difference between binary and hex?
Binary is base 2 (0,1). Hex is base 16 (0-9, A-F). Both represent the same numbers. Hex is more compact (4 binary digits = 1 hex digit).
How do I convert between bases?
Calculator does it instantly. By hand: divide repeatedly by the target base, collect remainders in reverse order.
Why does 1 KB sometimes equal 1024 bytes?
Computer scientists often use binary prefixes: 1 KiB = 1024 bytes. Marketing usage typically uses 1 KB = 1000. The IEC formalized 'kibi/mebi/gibi' for the binary versions.
What is two's complement?
Standard way of representing signed integers in binary. Most significant bit indicates sign; negative numbers are bitwise inverted plus 1. Allows addition and subtraction with the same hardware.
Why is 36 the maximum base?
Because the conventional symbol set is the ten digits followed by the twenty-six letters, giving thirty-six symbols in total. Beyond that there is no agreed notation, though some encodings extend the alphabet with additional characters.
Why does 255 come up so often in computing?
Because it's one less than 256, so in binary it's eight ones, filling a byte completely. The same pattern gives 65535 and 4294967295 as the maximums for 16 and 32 bit unsigned values, which is why those figures recur.
How do I convert between binary and hexadecimal?
By grouping bits: four binary digits make one hexadecimal digit and three make one octal digit, because 16 and 8 are powers of 2. The conversion is purely mechanical and needs no arithmetic at all.
Why does one tenth repeat in binary?
Because a fraction terminates only when its denominator's prime factors all divide the base. Ten has a factor of 5, which does not divide 2, so one tenth repeats forever in binary and must be truncated in floating point.
Why do we still use base 60 for time?
Because 60 has an unusual number of divisors, so common fractions of an hour come out whole. The same divisibility argument explains 12 and 360, and it's why decimal time proposals have never displaced the Babylonian system.
Does base 64 compress data?
No, it expands it by roughly a third. It encodes arbitrary binary as printable characters so data can pass through text-only channels, which is a transport concern rather than a size one and is frequently misunderstood.
Why did positional notation matter historically?
Because it made arithmetic accessible to anyone rather than to specialists with an abacus. The decimal system with a zero placeholder developed in India, reached Europe via the Islamic world, and took centuries to displace Roman numerals.
Related calculators
Correlation Coefficient · Mean Median Mode · Matrix 3x3 Determinant · Quadratic Equation · Geometric Series