Beginner

Binary Calculator — Binary, Octal, Decimal & Hex Converter

Enter a number in binary, octal, decimal or hexadecimal and instantly see it in all four bases — with the binary representation grouped into 4-bit nibbles.

Input base

Non-negative whole number
Binary (grouped nibbles)
0010 1010
十進位
42
Binary
00101010
Octal
52
Hexadecimal
0x2A
Significant bits
6
Bytes required
1
Set bits (population count)
3
0326496128160192224256Decimal value on the binary number line
計算結果僅為一般資訊用途的估算值,並非專業建議——在仰賴重要結果之前,請務必自行獨立查證。 閱讀完整免責聲明.
快速解答

此計算機如何運作?

To convert a decimal n to binary: repeatedly divide by 2, collect remainders (LSB first). To convert binary to decimal: Σ bᵢ × 2ⁱ. One hex digit = 4 binary bits; one octal digit = 3 binary bits. Enter any base and the converter shows all four representations plus bit count, byte count, and popcount.

公式
Decimal n = Σ dᵢ × baseⁱ • Reverse: repeated division by the target base
How this is calculated

Every non-negative integer can be represented in any positional numeral system by expressing it as a sum of powers of the base. In binary (base 2), each bit is a coefficient of a power of 2: the rightmost bit is 2⁰ (= 1), the next is 2¹ (= 2), then 2² (= 4) and so on. To convert a decimal number to binary, repeatedly divide by 2 and collect the remainders from bottom to top. Hexadecimal (base 16) uses digits 0–9 plus A–F for values 10–15; one hex digit encodes exactly four bits, making hex a compact notation for binary data.

The tool converts your input into an internal BigInt value (arbitrary precision), so it handles numbers far beyond JavaScript's safe integer limit of 2⁵³. The binary output is zero-padded to the nearest multiple of 4 bits (nibble boundary) and grouped into nibbles with spaces for readability, which is the standard way engineers read binary in hardware and protocol contexts.

The population count (number of set bits, also called Hamming weight or popcount) tells you how many bits are 1. It is used in error detection, cryptography, and CPU intrinsics like POPCNT. The byte count shows the minimum number of 8-bit bytes needed to store the value.

常見問題

One nibble (4 bits) corresponds to exactly one hexadecimal digit, so grouping makes it easy to verify the hex equivalent visually. For example, binary 1010 1111 = 0xAF. Nibble grouping is standard in hardware design, networking (IPv6, MAC addresses) and assembly-language programming.

A bit is the smallest unit of binary information — a single 0 or 1. A byte is 8 bits and can represent values 0–255 (unsigned). Most modern computers address memory in bytes. The "bytes required" stat shows how many 8-bit bytes are needed to store the entered number.

This converter handles non-negative integers only. Negative numbers require a sign representation such as two's complement, which is base- and word-size-specific. Use a dedicated two's complement calculator for signed conversions.

也稱為

binary to decimal converter
decimal to binary calculator
binary hex octal decimal converter
number base binary converter
binary digit converter
binary number system calculator
base 2 number conversion

APA

TG we-Calculate Editorial Team. (2026). Binary Calculator — Binary, Octal, Decimal & Hex Converter [Online calculator]. TG we-Calculate. https://we-calculate.com/zh-tw/calculator/binary-calculator

Chicago

TG we-Calculate Editorial Team. "Binary Calculator — Binary, Octal, Decimal & Hex Converter." TG we-Calculate. 2026. https://we-calculate.com/zh-tw/calculator/binary-calculator.

IEEE

TG we-Calculate Editorial Team, "Binary Calculator — Binary, Octal, Decimal & Hex Converter," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/zh-tw/calculator/binary-calculator

BibTeX

@misc{wecalculate_binary_calculator, title = {Binary Calculator — Binary, Octal, Decimal & Hex Converter}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/zh-tw/calculator/binary-calculator}}, year = {2026}, note = {TG we-Calculate} }

這個計算機對您有幫助嗎?