🔢

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.

Binary
Octal
Decimal
Hexadecimal

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

  1. Enter a number in any of the four input fields: Binary, Octal, Decimal, or Hexadecimal.
  2. The other three fields update instantly with the converted values.
  3. 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).

Frequently Asked Questions

Hexadecimal uses digits 0–9 and letters A–F (case-insensitive). The tool accepts both upper and lowercase hex input.
No. The converter supports integers only (positive, negative, and zero). Floating-point base conversion requires a different algorithm and is not currently supported.
Binary accepts only 0 and 1. Any other digit will cause an error. Check that you haven't accidentally typed a 2 or higher.
The tool uses JavaScript's standard integer representation. Very large numbers (beyond ±2^53) may lose precision. For cryptographic-scale numbers, use a big-integer library.