Number Base Converter — Binary, Octal, Decimal, Hex
Convert numbers between binary, octal, decimal, and hexadecimal with step-by-step explanation. Perfect for programmers and students. Browser-based.
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
- ✓Perfect for programming and learning
- ✓Useful for color code conversion
- ✓Support for large numbers (up to safe integer)
- ✓All calculations run locally in your browser
How to Use
- 1Select the input number base (binary, octal, decimal, or hexadecimal).
- 2Enter your number in the input field.
- 3All conversions display instantly.
- 4Click copy button to copy any result.
- 5Switch input base to convert from different formats.
- 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.
- 7Use hexadecimal input mode to convert CSS color codes (#FF5733) to decimal RGB values (255, 87, 51) or binary bit patterns.
- 8Compare binary and octal representations of the same number to understand how different bases express the same quantity.
- 9Convert network subnet masks between binary (11111111111111111111111100000000) and dotted decimal (255.255.255.0) equivalents.
- 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.
Related Tools
Color Converter — Convert HEX, RGB, HSL, HSV & CMYK Online
Convert colors between HEX, RGB, HSL, HSV, and CMYK formats instantly. Pick a color, see all converted values. Browser-based, no data uploaded.
Unit Converter — Length, Weight, Temperature, Volume, Area
Convert between metric and imperial units for length, weight, temperature, volume, and area. Instant, accurate, and easy to use. Browser-based.