About the Number Base
The number base converter turns an integer between binary, octal, decimal, hexadecimal and any custom base from 2 to 36 at once. Type a value in any of the standard bases and it shows the same number in all the others simultaneously, plus a field where you can pick an arbitrary base such as 36 for a compact alphanumeric encoding.
What sets it apart from a quick calculator conversion is precision. It uses JavaScript's BigInt under the hood instead of ordinary floating-point numbers, so conversions stay exact even for integers far beyond the 2^53 point where regular numbers start losing precision. A 40-digit decimal integer converts to base 36 without a single digit drifting, which matters for things like large database IDs, cryptographic values or 64-bit and 128-bit constants that a standard parseInt-based tool would silently round.
Common uses include reading a hex memory address or color value back into decimal, decoding a bitmask or set of flags, turning a raw octal file mode into decimal for scripting, or converting an ID into a short base-36 string for a URL. Because it accepts any base from 2 to 36, it also covers less common radixes that show up in specific protocols, legacy systems or puzzle formats.
All conversion happens locally in the browser using BigInt arithmetic. Nothing you type is sent anywhere, so it is safe to paste in an internal ID, a key fragment or any other value you would rather not send to a third-party service.
How to use it
- Enter your number in the value field, in whichever base you already have it.
- Select the matching input base (binary, octal, decimal or hex) from the dropdown.
- Read the converted values for the three remaining standard bases at once.
- Set a custom base from 2 to 36 in the base field to see the same number in that radix.
- Prefix hex or binary literals with 0x or 0b if that matches how the value was given to you; the tool strips the prefix before parsing.
- For very large integers, paste the full digit string; BigInt handles it without losing precision.
Examples
- Decimal 255 becomes binary 11111111, octal 377, hex ff.
- Hex deadbeef becomes decimal 3735928559.
- Decimal 1000000 in base 36 becomes lfls.
- Binary 101010 becomes decimal 42, octal 52, hex 2a.
- A 40-digit decimal integer converts to base 36 exactly, with no rounding, unlike Number-based conversions.
- Octal 755 (a common file permission mode) becomes decimal 493, hex 1ed.
Why BigInt instead of parseInt or Number
JavaScript's Number type is a 64-bit float, and it can only represent integers exactly up to 2^53 - 1 (9,007,199,254,740,991). Past that point, parseInt and Number-based conversions silently start rounding, returning a value that looks plausible but is wrong. This tool parses digit by digit into a BigInt, which has no upper bound, so a 30 or 40-digit integer converts with every digit intact. This matters most for 64-bit hex constants, large snowflake-style IDs, and cryptographic or hash-derived values, all of which routinely exceed the safe integer range.
Standard bases at a glance
Each base has its own conventional use case, which is often the reason someone needs to convert between them in the first place.
- Binary (base 2): raw bit patterns, flags, bitmasks, boolean logic
- Octal (base 8): Unix file permission modes (see the chmod calculator), legacy Unix APIs
- Decimal (base 10): the default for arithmetic and most application-level IDs
- Hexadecimal (base 16): memory addresses, color codes, hashes, byte-level data, MAC addresses
- Base 36 and other custom bases: compact alphanumeric encodings for short IDs, using 0-9 then a-z as digits
Reading and writing custom bases correctly
Any base from 2 to 36 is supported because standard digits (0-9) combined with the 26 letters of the alphabet (a-z) give exactly 36 unique symbols, the practical ceiling for single-character digits without inventing new symbols. In a base above 10, letters extend the digit set in order: a equals 10, b equals 11, and so on up to z equals 35. Base 36 is popular for URL-shortener style IDs because it packs the same numeric range into noticeably fewer characters than decimal, while staying case-insensitive and easy to type.
Common mistakes when converting bases by hand
- Forgetting that 0x or 0b prefixes are notation, not part of the number itself, and including them when pasting into a plain decimal field
- Assuming a leading zero means octal everywhere; that convention is C-family specific and not universal, so this tool treats a leading zero as a normal decimal digit unless the input base is explicitly set to octal
- Using calculator apps or Number()-based scripts for values beyond 2^53 and getting silently rounded results with no error
- Mixing up big-endian and little-endian byte order when reading a hex dump; this tool converts the numeric value only, it does not reorder bytes
Frequently asked questions
What bases does the converter support?
Binary, octal, decimal and hexadecimal are shown directly, and any custom base from 2 to 36 can be set separately using digits 0-9 and letters a-z.
Can it handle numbers larger than a normal integer?
Yes. It uses BigInt for arbitrary-precision arithmetic, so integers far beyond the 2^53 safe-integer limit of regular JavaScript numbers still convert exactly, with no rounding.
How do I convert to base 36?
Enter your number and its input base as usual, then set the custom base field to 36. For example, decimal 1000000 becomes lfls in base 36.
How do I do a base36 to decimal conversion?
Set the input base to your custom base value (36 in this case) and type the base-36 string as the value; the decimal row in the output shows the converted result.
Does it convert decimals or fractional numbers?
No. It works with integers only. Fractional values, floating-point numbers and negative-number handling beyond a leading minus sign are not supported.
Is my input sent to a server?
No. All parsing and conversion happen locally in your browser using BigInt, so the values you enter never leave your device.
What is the difference between this and JavaScript's parseInt?
parseInt converts through a standard floating-point Number, which loses precision above 2^53. This tool parses directly into a BigInt, so it stays exact for arbitrarily large integers where parseInt would silently round.
How do I convert hex to decimal?
Set the input base to hex and type the value, for example ff or deadbeef; the decimal row shows 255 and 3735928559 respectively.
Why is my leading zero being read as decimal instead of octal?
This tool does not infer octal from a leading zero, since that is a language-specific convention rather than a universal rule. Select octal explicitly as the input base if that is what you mean.
Can I convert a Unix file permission like 755 to another base?
Yes, set the input base to octal and enter 755; it converts to decimal 493 and hex 1ed. For working with permission bits directly, the chmod calculator is the more direct tool.