User Rating 0.0
Total Usage 0 times
0 bits
Is this tool helpful?

Your feedback helps us improve.

About

Radix conversion errors propagate silently. A misinterpreted binary payload in protocol design or firmware can cause data corruption that surfaces days later. This tool converts binary strings of arbitrary length to any target base b where 2 b 64, using native BigInt arithmetic to avoid the IEEE 754 53-bit mantissa limit that breaks standard parseInt past 253. The digit alphabet follows the Base64 convention: 0 - 9, then A - Z, then a - z, then + and /.

Limitation: this tool assumes unsigned (non-negative) integers only. Two’s complement or floating-point binary representations require separate decoding before input. Leading zeros in the binary input are stripped before conversion. For bases above 36, the output is case-sensitive: A (value 10) and a (value 36) are distinct digits.

binary converter base converter number system radix conversion binary to hex binary to octal binary to decimal arbitrary base

Formulas

The binary input string B of length n is first converted to a decimal integer D using positional notation:

D = n1i=0 Bi 2n1i

The decimal value D is then converted to the target base b by repeated Euclidean division. At each step, the remainder r gives the next digit (least significant first):

r = D mod b , D D rb

Digits are collected until D = 0, then reversed. Each remainder r is mapped to a character from the alphabet: 0 - 9 digits, 10 - 35 A - Z, 36 - 61 a - z, 62 +, 63 /.

Where Bi = the i-th bit (from left), n = total bit count, b = target base (2 - 64), D = intermediate decimal (BigInt), r = remainder digit value.

Reference Data

BaseNameDigit SetCommon Use
2Binary0-1CPU instructions, bitfields
3Ternary0-2Balanced ternary logic, Setun computer
4Quaternary0-3DNA encoding (A, T, G, C mapping)
5Quinary0-4Bi-quinary coded decimal systems
7Septenary0-6Week-day encoding
8Octal0-7Unix file permissions (chmod 755)
10Decimal0-9Human-readable numbers
12Duodecimal0-9, A - BTime (12 hours), imperial units
16Hexadecimal0-9, A - FMemory addresses, CSS colors, MAC addresses
20Vigesimal0-9, A - JMayan numeral system
32Base320-9, A - VCrockford encoding, TOTP secrets (RFC 4648)
36Base360-9, A - ZURL shorteners, compact IDs
58Base58Alphanumeric minus 0OIlBitcoin addresses, IPFS CIDs
60Sexagesimal0-9, A - Z, a - xBabylonian math, time (60 sec/min)
62Base620-9, A - Z, a - zShort URLs (bit.ly), session tokens
64Base640-9, A - Z, a - z, +, /Email attachments (MIME), data URIs, JWT

Frequently Asked Questions

JavaScript's parseInt returns a 64-bit IEEE 754 float, which has only 53 bits of integer precision. Any binary string longer than 53 digits risks silent truncation. This tool uses BigInt, which has no upper precision limit, so a 10,000-bit binary string converts exactly.
For bases 2-10, digits are 0 - 9. For bases 11-36, uppercase A - Z are appended (matching the standard hexadecimal convention). For bases 37-62, lowercase a - z represent values 36-61. For bases 63-64, the characters + (62) and / (63) are used, consistent with RFC 4648 Base64. This means output is case-sensitive above base 36.
No. The converter treats all input as an unsigned binary integer. If your source uses two's complement (e.g., an 8-bit signed byte where 11111111 means −1), you must manually interpret the sign bit before entering the magnitude here. A future extension could add signed-mode support.
There is no hard-coded limit. BigInt in modern browsers handles millions of digits. Practically, inputs up to ~100,000 binary digits convert in under one second. Performance depends on the browser's BigInt implementation. Chrome V8 and Firefox SpiderMonkey are both well-optimized for this.
A Base64 encoder (like btoa) encodes raw byte streams into printable ASCII by grouping 6 bits at a time. This tool performs mathematical radix conversion: it treats the entire binary string as one large integer and computes its representation in the target base. The results are numerically equivalent but structurally different. For instance, converting 11111111 here to base 64 yields a single digit 3/ (value 255), whereas Base64-encoding the byte 0xFF produces /w== (with padding).
Leading zeros are stripped before conversion because they do not change the numeric value. The input 000001010 is treated identically to 1010. If your protocol requires preserving bit-width (e.g., fixed 8-bit or 32-bit fields), note the original width separately.