Convert numbers between binary, octal, decimal, and hexadecimal in any direction. Enter one base and all four results appear instantly — browser-only.
Input base
Select a base and enter a number
A number base controls which digits can represent a value. Decimal (base 10) is used for everyday arithmetic, while binary (base 2), octal (base 8), and hexadecimal (base 16) are common in computing. This converter validates a value in one base and shows its equivalent representation in the other three.
| Base | Valid digits | Common use | Display prefix |
|---|---|---|---|
| 2 | 0–1 | Bits, masks, and digital logic | 0b |
| 8 | 0–7 | Unix permissions and legacy systems | 0o |
| 10 | 0–9 | Human-readable arithmetic | None |
| 16 | 0–9, A–F | Memory addresses, colors, and debugging | 0x |
Prefixes identify a representation in source code. They are shown beside results, but input fields expect digits without 0b, 0o, or 0x.
Every digit is multiplied by a power of its base. For example, binary 1010 means:
1 × 2³ + 0 × 2² + 1 × 2¹ + 0 × 2⁰ = 10
Hexadecimal is compact because one digit represents four binary bits. Therefore, FF is decimal 255 and binary 11111111. Octal digits represent groups of three bits, so octal 10 is binary 1000.
755Decimal input may include a leading minus sign. Results use a leading minus sign as well; they are not two's-complement bit patterns. The converter accepts JavaScript safe integers through 2^53 - 1 in magnitude. Use a big-integer implementation for larger identifiers, hashes, or cryptographic values.
Bit length counts digits in the binary representation, excluding a leading minus sign. Bytes round that length up to the next eight-bit boundary.
const decimal = Number.parseInt("1010", 2);
const hexadecimal = decimal.toString(16).toUpperCase();
console.log(decimal); // 10
console.log(hexadecimal); // A
value = int("FF", 16)
print(value) # 255
print(bin(value)) # 0b11111111
print(oct(value)) # 0o377
SELECT CONV('1010', 2, 10) AS decimal_value,
CONV('10', 10, 16) AS hexadecimal_value;
| Representation | Strength | Trade-off |
|---|---|---|
| Binary | Shows individual bits clearly | Long for large values |
| Octal | Compact three-bit grouping | Less common in modern application code |
| Decimal | Easy for people to read and calculate | Hides bit-level structure |
| Hexadecimal | Compact four-bit grouping | Requires remembering A–F values |
All conversion happens locally in your browser. Input is not uploaded, and each result can be copied independently.
This tool is provided for general informational and utility purposes only. Results may be inaccurate, incomplete, outdated, or contain errors. Always verify results before relying on or using them.
Some tools may use AI, automated processing, third-party services, or server-side processing. Do not rely on these tools as a substitute for professional advice.
Use at your own risk. BestToolOnline makes no guarantees regarding the accuracy, reliability, completeness, availability, or suitability of results, to the maximum extent permitted by applicable law.
See our Terms of Service and Privacy Policy for complete details.