Free · Instant · Client-Side
Convert numbers between binary, octal, decimal, and hexadecimal instantly. Enter any number in any base and get all four representations.
Input base
What is number base conversion?
Number base conversion changes how a number is represented by changing the base (radix). Decimal (base 10) uses digits 0-9. Binary (base 2) uses only 0 and 1. Octal (base 8) uses 0-7. Hexadecimal (base 16) uses 0-9 and A-F. All represent the same numeric value — just written differently. Example: decimal 255 = binary 11111111 = hex FF.
Why do programmers use hexadecimal?
Hexadecimal (base 16) is compact: one hex digit equals exactly 4 binary bits, so a byte (8 bits) is always two hex digits. This makes memory addresses, color codes (#FF5733), and binary data much shorter. 0xFF is far easier to read than 11111111. Memory addresses and file offsets in debuggers are nearly always shown in hex.
How do I convert binary to decimal?
Multiply each binary digit by 2 raised to its position power (right to left, starting at 0), then sum. Example: 1011 = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11. In code: parseInt('1011', 2) in JavaScript, int('1011', 2) in Python, Convert.ToInt32('1011', 2) in C#.
How do I convert decimal to hexadecimal?
Repeatedly divide by 16 and note the remainders. Remainders 10-15 become A-F. Example: 255 ÷ 16 = 15 remainder 15 (F), 15 ÷ 16 = 0 remainder 15 (F). Reading remainders upward: FF. In code: (255).toString(16) in JavaScript gives 'ff', hex(255) in Python gives '0xff'.
What is octal (base 8) used for?
Octal is used primarily in Unix/Linux file permissions. chmod command uses three octal digits: read (4), write (2), execute (1). chmod 755 sets owner as rwx (7=4+2+1), group as r-x (5=4+0+1), others as r-x. Each octal digit maps directly to a 3-bit binary group, making it a compact representation.
How large can numbers be in this converter?
This tool uses JavaScript's Number type which safely handles integers up to 2^53 - 1 (9,007,199,254,740,991 in decimal). For most purposes including 32-bit and 64-bit integers this is sufficient. For cryptographic or arbitrary-precision numbers beyond this range, use JavaScript's BigInt or a dedicated big number library.
| Feature | Anvya AI | rapidtables.com | Calculator.net |
|---|---|---|---|
| All 4 bases at once | ✓ | ✗ | ✓ |
| Input in any base | ✓ | Partial | Partial |
| Instant live conversion | ✓ | ✗ | ✗ |
| Input validation errors | ✓ | ✗ | ✗ |
| No ads | ✓ | ✗ | ✗ |
| Works offline | ✓ | ✗ | ✗ |
| Free forever | ✓ | ✓ | ✓ |