Skip to main content
UFOZoo

Number Base Converter: Binary, Octal, Decimal, Hex

Number base converter online: integer conversions between binary, octal, decimal, and hexadecimal, with all four results shown at once.

Updated 2026-08-26

Related Tools

Features

  • Convert between binary, octal, decimal, and hexadecimal
  • Instant conversion as you type
  • Support for negative numbers in decimal
  • Validate input for each number base
  • Display all conversions simultaneously
  • Copy result with one click
  • Programming and learning aid: see the same value in all four bases side by side for debugging and study
  • Useful for color code conversion: type #FF5733-style hex values and read the decimal RGB equivalents
  • Support for large numbers up to JavaScript's safe integer (9 quadrillion)

How to Use

  1. 1Select the input number base (binary, octal, decimal, or hexadecimal).
  2. 2Enter your number in the input field.
  3. 3All conversions display instantly.
  4. 4Click copy button to copy any result.
  5. 5Switch input base to convert from different formats.
  6. 6Convert an IP address to its binary and hex form: enter the decimal representation (e.g., 192.168.1.1 as 3232235777) to see all base equivalents.
  7. 7Use hexadecimal input mode to convert CSS color codes (#FF5733) to decimal RGB values (255, 87, 51) or binary bit patterns.
  8. 8Compare binary and octal representations of the same number to understand how different bases express the same quantity.
  9. 9Convert network subnet masks between binary (11111111111111111111111100000000) and dotted decimal (255.255.255.0) equivalents.
  10. 10Type a decimal number to instantly see its binary, octal, and hex forms side by side, perfect for studying base conversions.

Frequently Asked Questions

What is a number base?

A number base (or radix) is the number of unique digits used to represent numbers. Binary (base 2) uses 0-1, octal (base 8) uses 0-7, decimal (base 10) uses 0-9, and hexadecimal (base 16) uses 0-9 and A-F. Different bases are useful in different contexts.

Why do programmers use different number bases?

Binary is the native language of computers. Hexadecimal is a compact way to represent binary (each hex digit = 4 binary digits). Octal was historically used in some systems. Decimal is natural for humans. Programmers often need to convert between these bases for debugging, bit manipulation, and understanding memory addresses.

What is hexadecimal used for?

Hexadecimal is widely used in programming for: color codes (e.g., #FF0000 for red), memory addresses, binary data representation, and machine code. Each hex digit represents 4 bits, making it a compact way to work with binary data. For example, byte values (0-255) fit in two hex digits (00-FF).

Can I convert negative numbers?

Yes, but only in decimal input mode. The converter will show the two's complement representation in other bases. For example, -1 in decimal becomes a very large positive number in binary because JavaScript uses two's complement for negative numbers.

What's the maximum number I can convert?

The converter supports numbers up to JavaScript's safe integer limit (2^53 - 1 = 9,007,199,254,740,991). This is approximately 9 quadrillion. Larger numbers may lose precision due to JavaScript's number representation.

How do I read the results?

Each result shows the number in a different base. Binary shows the number as a sequence of 0s and 1s. Octal uses digits 0-7. Decimal is the familiar base-10 number. Hexadecimal uses 0-9 and A-F (uppercase). All results represent the same value, just in different representations.

How do I convert a decimal number to binary manually?

Divide the decimal number by 2 repeatedly, recording each remainder (0 or 1) from right to left. For 13: 13÷2=6 rem 1, 6÷2=3 rem 0, 3÷2=1 rem 1, 1÷2=0 rem 1. Reading remainders upward: 1101. The tool does this instantly.

What is the octal number system used for?

Octal (base 8) was historically used in early computing systems like PDP-8 and UNIX file permissions (chmod 755). Each octal digit represents 3 bits. While less common today, it's still encountered in POSIX permission masks and some embedded systems.

Can I convert numbers with decimal points (floating point)?

This converter handles integers only. Floating-point conversion is more complex because it involves sign, exponent, and mantissa bits (IEEE 754 standard). For example, the float 3.14 has a very different binary representation than integer 3.

How is hexadecimal used in color codes?

Colors in HTML/CSS are hex triplets: #RRGGBB. Red is #FF0000 (FF=255), Green is #00FF00, Blue is #0000FF. Each pair represents the intensity of that color channel (0-255). Try converting FF in hex mode to see it equals 255 in decimal.

What does the octal number 0777 mean in file permissions?

In Unix, chmod 0777 sets full permissions. Each octal digit maps to 3 bits: read(4), write(2), execute(1). 7 = 4+2+1 = rwx. 0777 means owner(rwx), group(rwx), others(rwx). Try entering 777 in octal mode to see the binary (111111111) representation.

How do I convert a number with decimals to another base?

Manually, separate the integer and fractional parts: convert the integer part by repeated division and the fraction by repeated multiplication, then combine. For example, 10.5 in decimal becomes 1010.1 in binary. Note that this converter handles integers only: a fractional part must be converted by hand, since the tool will reject a decimal point.

Why does the result look different from a calculator?

Different tools may handle leading zeros, negative numbers, or fractional input differently. This converter shows final results only; it does not print step-by-step working. To verify a result, convert it back: enter the output value with its own base selected as the input base, and you should recover the original number. For the manual algorithm, follow the division method described above.

I selected the wrong input base and every result looks wrong. How do I spot it?

Check the first digits: '1010' only means ten if binary is selected; typed while decimal is selected, it is one thousand and ten. Quick sanity checks: decimal 10 is 1010 in binary, 12 in octal, and A in hex. If a result looks 3-10x larger than expected, the base is almost certainly wrong. Re-select the input base and all four columns recompute instantly.

Negative numbers come out as a long string of 1s; is that a bug?

No, that is two's complement, the standard way computers store negatives. At 32-bit width, -1 becomes 32 ones (11111111111111111111111111111111). This converter shows the raw two's complement of your JavaScript number, which is 64-bit; that is why -1 displays as 64 ones. In real systems the width comes from the data type (int8/int16/int32), so when you copy a value, keep only the bits of your target width.