Number Base Converter
Convert bin/oct/dec/hex locally with BigInt.
Number Base Converter translates integers between binary, octal, decimal, and hexadecimal in your browser. Paste values with or without standard prefixes, get BigInt-accurate results, and copy formatted output for debugging, low-level code, and computer science homework—without uploading data.
How it works
Select the source base, enter a value, and choose the target base. The tool validates digits for the source radix, parses with BigInt, and formats the result with optional 0b, 0o, or 0x prefixes. Invalid characters produce immediate, specific error messages.
Benefits
- Binary, octal, decimal, and hex in one view
- BigInt parsing avoids precision loss on large values
- Clear invalid-digit errors per base
- Optional prefix support and base swap
Use cases
- Convert memory addresses and bitmask constants
- Check homework answers for radix conversion
- Translate color channel values between dec and hex
- Debug embedded firmware register values
Best practices
- Match the source base to how your input is written
- Include 0x or 0b prefixes only when unambiguous
- Use decimal for human-readable magnitudes, hex for bitwise work
- Verify bit width requirements in your target language
Common mistakes
- Entering letters in decimal mode
- Using 8 or 9 in octal input
- Assuming leading zeros change the numeric value
- Mixing bases without updating the source base dropdown
Privacy
Numbers are converted locally in your browser. ToolHub does not receive your input unless you separately enable on-device history.
Frequently asked questions
- Which number bases are supported?
- You can convert between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Choose source and target bases from the dropdowns.
- Can I use prefixes like 0x or 0b?
- Yes. Optional 0x, 0b, and 0o prefixes are recognized when they match the selected source base and stripped before parsing.
- Does the converter handle large integers?
- Yes. Parsing and formatting use JavaScript BigInt so very large values convert without floating-point rounding errors.
- What happens if I enter invalid digits?
- You get a clear error explaining which digits are allowed for the selected base—for example, 8 is invalid in octal.
- Does this tool upload my numbers?
- No. All conversion happens locally in your browser. Values never leave your device for this tool.
- Can I swap input and output bases?
- Use Swap bases after a successful conversion to move the result into the input field and exchange the from/to base selections.
Related tools
Case Converter
text
Convert naming cases locally with smart word splitting.
- case
- camelcase
- snake-case
- kebab-case
Binary Text Converter
converter
Convert text to binary and binary to text.
- binary
- text
- converter
- encoding
Hex Text Converter
converter
Convert text to hex and hex to text.
- hex
- text
- converter
- encoding
Area Unit Converter
converter
Convert area units like acres, hectares, and m².
- area
- unit-converter
- converter
- measurement
ASCII Code Converter
converter
Convert text to character codes and back.
- ascii
- unicode
- text
- converter
Data Size Converter
converter
Convert bytes, KB, MB, GB, TB, and binary units.
- data-size
- unit-converter
- converter
- storage