Number Base Converter

Convert between binary, octal, decimal, and hex

Input Base
Value

Enter a number to convert between bases

About This Tool

Number base conversion is the process of representing a numeric value in different positional numeral systems. The most commonly used bases in computing are binary (base 2, digits 0-1), octal (base 8, digits 0-7), decimal (base 10, digits 0-9), and hexadecimal (base 16, digits 0-9 and A-F). Binary is the fundamental language of computers, representing data as sequences of ones and zeros. Hexadecimal is widely used in programming for memory addresses, color codes, and binary data representation because each hex digit maps neatly to four binary digits. Our free online number base converter lets you instantly convert between binary, octal, decimal, and hexadecimal, with support for large numbers and negative values.

How to Use

  1. Enter a number in any supported base into the input field. The tool auto-detects the base from common prefixes: 0b for binary, 0o for octal, 0x for hexadecimal, or plain digits for decimal.
  2. The converted values in all four bases (binary, octal, decimal, hexadecimal) are displayed instantly. Each output includes proper prefix notation and formatted grouping for readability.
  3. Use the base selector to manually specify the input base if your number uses a non-standard format or if you want to force a specific interpretation.
  4. Copy any converted value to your clipboard. Binary output is grouped in sets of 4 digits, and hexadecimal output uses uppercase letters by default, both of which are common conventions in programming.

Frequently Asked Questions

Hexadecimal is preferred in programming because each hex digit represents exactly 4 binary digits (bits), making it a compact and readable way to represent binary data. For example, the byte value 11111111 in binary is simply FF in hex. This makes hex ideal for memory addresses (e.g., 0x7FFF), color codes (e.g., #FF5733), and debugging binary data. Converting between hex and binary is straightforward, unlike decimal.
To convert binary to decimal, multiply each digit by 2 raised to the power of its position (starting from 0 on the right) and sum the results. For example, binary 1101 = (1 x 2^3) + (1 x 2^2) + (0 x 2^1) + (1 x 2^0) = 8 + 4 + 0 + 1 = 13 in decimal. Our tool performs this conversion instantly for any length of binary number.
Octal (base 8) was historically used in computing because each octal digit represents exactly 3 binary digits, making it useful for systems with word lengths that are multiples of 3 bits. Today, octal is less common than hexadecimal but is still used in Unix file permissions (e.g., chmod 755), some programming languages as an alternative number literal format, and in certain embedded systems and digital electronics contexts.
This tool uses JavaScript's built-in number handling, which can safely represent integers up to 2^53 - 1 (9,007,199,254,740,991). For larger numbers, the conversion may lose precision. Binary and hexadecimal representations of very large numbers may not be fully accurate.
Advertisement