Number Base Converter: A Practical Guide
Use Number Base Converter to convert signed integers between binary, octal, decimal and hexadecimal. The result changes the written representation while preserving the integer value. Fractional numbers and two’s-complement bit-width interpretation are not part of this form.
How to Use Number Base Converter
- Enter Value in the source unit.
- Choose From and To carefully.
- Select Convert.
- Read the result with its unit and round only as appropriate for the task.
Integer Digits and Radices
Binary uses 0–1, octal 0–7, decimal 0–9 and hexadecimal 0–9 plus A–F. The parser checks every digit against the selected base and uses integer arithmetic rather than rounding through a floating-point value.
Enter the digits themselves without a 0x or 0b prefix. A minus sign represents a negative mathematical integer, not a fixed-width machine encoding. Leading zeroes are not preserved as a width specification.
Worked Example
Binary 1010 converts to decimal 10 and hexadecimal A. Hexadecimal FF converts to decimal 255.
The binary value 11111111 is 255 here; it is not automatically interpreted as -1 in an eight-bit signed format.
Use a different byte-encoding scheme: use the Base64 Encoder.
Generate an integer within bounds: use the Random Number Generator.
Checks and Common Mistakes
- Select the correct input base.
- Do not include unsupported prefixes.
- Do not enter decimal fractions.
- Keep bit-width interpretation separate.
Frequently Asked Questions
Can I convert very large integers?
The implementation uses BigInt-style integer handling, though browser and input-size limits still apply.
Does it preserve leading zeros?
The output is a normalized integer representation, not a fixed-width bit string.
Why is a digit rejected?
The digit may not belong to the selected base, such as 8 in octal.
Related Tools for the Next Step
- Base64 Encoder: Use a different byte-encoding scheme.
- Random Number Generator: Generate an integer within bounds.
- JSON Validator: Check numeric data in JSON with its own precision limits.
- Character Counter: Inspect a representation’s text length.
Reference
Further reading: MDN BigInt.
