Number base converter
About Number Base Converter
The number base converter translates integers between binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). Enter one value per line to convert bit masks, color values, file permissions, protocol fields, memory addresses or IDs without a calculator or a throwaway script.
Conversions use JavaScript BigInt from the first digit to the last. Values never pass through a floating-point Number, so integers far beyond the 53-bit safe limit stay exact. Signed values, underscore separators and matching 0b, 0o or 0x prefixes are supported.
Runs in your browser. Nothing is uploaded. Turn on uppercase hex to match technical docs, or add prefixes to binary, octal and hex output. The engine supports any base from 2 to 36, and the page shows the four bases developers use most.
How it works
Select the source and destination bases
Choose BIN, OCT, DEC or HEX for each side. Every input character is checked against the source base. Binary rejects digits other than 0 and 1, octal rejects 8 and 9, and hex accepts 0-9 plus A-F. Errors name the input line.
Keep large integers exact with BigInt
The converter builds the value with integer multiplication and addition, then writes it straight into the target base. There is no IEEE 754 rounding. Large account IDs, 64-bit masks and checksums stay exact, where a normal JavaScript number would corrupt them.
Use signs, separators and prefixes
A leading plus or minus sign is accepted. Underscores can group digits for readability. The 0b, 0o or 0x prefix is accepted when it matches the input base. The output prefix option adds the marker for bases 2, 8 and 16.
Convert several values at once
Put one integer on each line and you get one result per line. Blank lines are skipped. The converter stops at the first invalid value and reports its line. You never get a partial or rounded batch without knowing.
Frequently asked questions
How large can the numbers be?
Each integer can have up to 4,096 digits. BigInt keeps every digit exact, so that limit only protects browser speed, not precision. There is no 32-bit, 53-bit or 64-bit ceiling.
Does the converter support negative numbers?
Yes. Add a leading minus sign in any base. The sign is kept apart from the digits and appears before any output prefix, as in -0xFF.
Can I paste 0x, 0b or 0o prefixes?
Yes, when the prefix matches the source base: 0x for hex, 0b for binary and 0o for octal. Decimal input takes no prefix.
Why use BigInt instead of parseInt?
parseInt returns a floating-point Number, which cannot represent every integer above 9,007,199,254,740,991 exactly. BigInt does arbitrary-precision integer math and avoids that limit.
Are my numbers uploaded for conversion?
No. Validation and conversion run in your browser. No account is needed.
Learn more
Sources & last verified
We checked this tool's behavior and the claims on this page against the specifications below on . The tool runs in your browser, so the output you see is exactly what the engine produced.
Found a wrong result or an outdated claim? Report an error and we will check it again.