Number base converter
Convert an integer between bases 2–36. Invalid digits are rejected. Nothing is uploaded.
Docify's number base converter turns an integer from one radix into another in your browser. Bases are 2–36. Digits are 0-9a-z (case-insensitive); each digit must be less than the from-base. Parse uses Horner's method on BigInt: value * radix + digit. Output is BigInt.prototype.toString(radix). Convert is a button, not as-you-type. Not Number.parseInt, not two's complement, and not a float dump. Nothing is uploaded.
From base
To base
Input
Output
How it works
- Convert is a button, not as-you-type. Pick From and To bases (Binary 2, Octal 8, Decimal 10, Hex 16, or Custom 2–36). Load sample fills hex
ffto decimal and does not run Convert. Copy writes the output string. Nothing is uploaded. - Parse trims the input, accepts an optional leading
-, then reads at most 256 digits from0-9a-z(letters viatoLowerCase()). Each digit value must be less than the from-base. The integer is Horner's method onBigInt:value = value * radix + digit. This is notNumber.parseInt(that stops at the first invalid character and uses IEEE-754). - Output is
BigInt.prototype.toString(radix)(ECMA-262, lowercase). Uppercase reformats those letters and does not change the value. Leading zeros are dropped. Zero is0. A leading minus is a mathematical sign, not two's complement. - Rejected:
0x/0b/0oprefixes, underscores, interior spaces, fractions, scientific notation, bases outside 2–36, fixed-width two's complement, IEEE-754 dumps, and custom alphabets (not Base58 / Base62 / Base64).
FAQ
- Does this converter upload anything?
- No. Convert and copy run in your browser. The page does not send the number to a server.
- Which bases and digits are accepted?
- From and to bases are integers 2–36. Digits are 0–9 then a–z (case-insensitive). A digit’s value must be less than the chosen from-base, so 2 is invalid in binary and G is invalid in hex. Convert is a button, not as-you-type. An optional leading minus is a mathematical sign, not two’s complement. Prefixes (0x, 0b, 0o), underscores, spaces inside the number, fractions, and scientific notation are rejected.
- How is the number converted?
- The input is trimmed, then each digit is folded with Horner’s method on BigInt: value = value * radix + digit. Output is BigInt.prototype.toString(radix) (ECMA-262, lowercase 0-9a-z). Uppercase reformats those letters only. This is not Number.parseInt, which stops at the first invalid character and is an IEEE-754 Number (exact integers only through 2^53 − 1).
- Is this two’s complement, Base58, or a float converter?
- No. There is no bit width, no two’s complement wrap, no IEEE-754 binary32/binary64 dump, and no custom alphabet (not Base58, Base62, or Base64). Zero is 0. Leading zeros are accepted on input and dropped on output. At most 256 digits after the optional minus.
Related
- Positional BigInt vs Number.parseInt
- Sibling tools: Hash generator and Color converter