Number Base Converter
Convert between binary, octal, decimal, and hexadecimal instantly. Type in any field and all others update in real time — free, no account required, nothing leaves your device.
How It Works
Pick a base
Click into the field for the base you already know — Binary, Octal, Decimal, or Hexadecimal. All four fields are live and interchangeable.
Type your number
Enter the digits valid for your chosen base. Invalid characters are ignored, keeping your input clean. Negative numbers are supported with a minus sign.
All bases update live
Every other base field updates in real time as you type. A summary panel shows all four representations side by side.
Copy and check bit width
Tap any copy icon to grab a result. The bit-width indicator shows whether the value fits in 8, 16, 32, or 64-bit unsigned integer ranges.
Why use this number base converter?
- Instant, bidirectional — edit any field and all others update at once. No dropdowns, no "convert" button.
- Your data never leaves your device — all conversions run in your browser using JavaScript. Nothing you enter is ever stored or shared.
- Supports large numbers — uses JavaScript's native
BigInt, so the converter handles integers well beyond the 32-bit and 64-bit limits without precision loss. - Negative numbers — prefix any value with a minus sign for correct cross-base negative representation.
- Bit-width guide — instantly see if your number fits within 8, 16, 32, or 64 unsigned bits.
The four number bases explained
| Base | Name | Digits | Common uses |
|---|---|---|---|
| Base 2 | Binary | 0, 1 | CPU logic, bitwise operations, digital circuits |
| Base 8 | Octal | 0–7 | Unix/Linux file permissions (chmod 755), legacy computing |
| Base 10 | Decimal | 0–9 | Everyday arithmetic, human-readable numbers |
| Base 16 | Hexadecimal | 0–9, A–F | HTML color codes, memory addresses, cryptographic hashes, Unicode |
Common conversions at a glance
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 1 0000 | 20 | 10 |
| 255 | 1111 1111 | 377 | FF |
| 256 | 1 0000 0000 | 400 | 100 |
| 1024 | 100 0000 0000 | 2000 | 400 |
| 65535 | 1111 1111 1111 1111 | 177777 | FFFF |
How to convert binary to decimal manually
Each binary digit (bit) represents a power of 2, starting from the rightmost position (2⁰):
- Write out the binary number: 1011
- Assign powers of 2 right to left: 1×2³ + 0×2² + 1×2¹ + 1×2⁰
- Calculate: 8 + 0 + 2 + 1 = 11
The converter above does this instantly for any size number.
How to convert decimal to hexadecimal manually
- Divide the decimal number by 16 and note the remainder.
- Continue dividing the quotient by 16 until it reaches 0.
- Map remainders 10–15 to letters A–F.
- Read the remainders from bottom to top — that is your hex value.
Example: 255 ÷ 16 = 15 remainder 15 (F); 15 ÷ 16 = 0 remainder 15 (F) → FF.
Hexadecimal in web development
Front-end developers encounter hexadecimal constantly. HTML/CSS color codes such as #1A2B3C are three hexadecimal byte pairs — red, green, and blue channels each running from 00 (0) to FF (255). Memory addresses in browser DevTools are displayed in hex. Unicode code points (e.g. U+1F600 for 😀) are hexadecimal.
Unix file permissions and octal
Linux and macOS file permissions use octal notation. The chmod 755 command sets read/write/execute for the owner (7 = 111 binary) and read/execute for group and others (5 = 101 binary). Understanding octal makes reading and writing permission masks intuitive.
Frequently Asked Questions
How do I convert binary to decimal?
Type your binary number into the Binary (BIN) field. The decimal equivalent appears instantly. Each binary digit represents a power of 2, read from right to left: 1010 = 1×8 + 0×4 + 1×2 + 0×1 = 10.
How do I convert decimal to hexadecimal?
Type your decimal number into the Decimal (DEC) field and the hexadecimal result appears in the Hex field automatically. For example, 255 decimal = FF hexadecimal.
What is hexadecimal used for?
Hexadecimal (base 16) compactly represents binary data — one hex digit maps to exactly four bits. It appears in HTML color codes, memory addresses, machine code, Unicode code points, and cryptographic hashes.
Can I convert negative numbers?
Yes. Type a minus sign before the digits (e.g. -1010 in binary or -255 in decimal) and all bases update with the correct negative value.
What does the bit-width indicator show?
It shows whether your number fits within 8-bit (max 255), 16-bit (max 65535), 32-bit (max ~4.29 billion), or 64-bit unsigned integer ranges. A green dot means it fits; grey means overflow.
Does this tool support very large numbers?
Yes. The converter uses JavaScript's native BigInt type, which handles integers of arbitrary size without rounding or precision loss.
Is my data stored or sent anywhere?
No. All conversions happen entirely in your browser using JavaScript. Nothing you enter is ever sent to or stored on any server.
Privacy & Security