Number Base Converter
Convert numbers between Binary, Octal, Decimal, and Hexadecimal instantly. Great for programming, networking, and digital electronics.
Supports optional minus sign (e.g. -42). Hex accepts A-F (case-insensitive). Prefixes like 0x are not required.
About Number Base Converter
Different number systems are used in different computing contexts: binary (base 2) for low-level operations, octal (base 8) for compact binary grouping, decimal (base 10) for human-readable values, and hexadecimal (base 16) for memory addresses and color codes.
How to Use
- Enter a number in any of the four input fields: Binary, Octal, Decimal, or Hexadecimal.
- The other three fields update instantly with the converted values.
- Prefix negative numbers with a minus sign (e.g.
-42).
How It Works
The tool uses JavaScript's parseInt(value, fromBase) to convert the input to a decimal integer, then uses number.toString(toBase) to convert to each target base. Negative values are handled by parsing the absolute value and re-applying the sign.
Example
Enter 255 in decimal: Binary = 11111111, Octal = 377, Hexadecimal = FF. This is why #FF0000 in CSS means full red (255, 0, 0).