Decimal to Binary Converter

4-bit nibble & 8-bit byte grouping · BigInt precision · Signed two's complement

Presets:
Decimal Integer (BigInt) 0 chars
Binary Output
0 chars

      
Ready
Ctrl+Enter Convert · 100% Local
Advertisement
Reserved fixed-height slot (CLS = 0.00) 728×90 320×100 300×50

Reading Bitmasks, Flags, and Subnet Octets in Grouped Binary

Converting decimal integers to binary is indispensable when debugging bitfield feature flags, Linux permission masks, CIDR subnet masks, and hardware status registers. Grouping output into 4-bit nibbles makes visual translation to hexadecimal effortless because every nibble maps 1-to-1 to a single hex digit (0000 = 0 through 1111 = F).

For bitwise flag fields, knowing the Hamming weight (number of set 1-bits) and exact bit indices confirms which flags are enabled without manually counting zeros from right to left. Negative inputs also display fixed-width two's complement representations so you can verify sign-extension behavior across 8-, 16-, 32-, and 64-bit registers.

  • Bit GroupingFormats output as raw bits, 4-bit nibbles (1111 1111), or 8-bit bytes with optional 0b prefix.
  • Bit MetricsReports exact minimum bit-width, Hamming weight (popcount of 1-bits), and aligned hex/octal.
  • Negative IntegersProvides both signed magnitude (-0b...) and fixed-width 8/16/32/64-bit two's complement bitstrings.
How many binary bits are needed to store a decimal integer N?

For any positive integer N, the minimum unsigned bit width is floor(log2(N)) + 1. For example, 255 requires 8 bits while 256 requires 9 bits.

What is Hamming weight (popcount)?

Hamming weight is the count of 1-bits in the binary representation—for example, decimal 255 (11111111) has a popcount of 8, while 256 (100000000) has a popcount of 1.

Why group binary digits in fours instead of threes?

4-bit nibble groups align directly with hexadecimal digits and 8-bit bytes, whereas 3-bit groups align with octal digits (such as Linux chmod permissions).