The core binary to decimal chart translates base-2 bit weights into base-10 integers. For standard 8-bit microcontroller ports and DIP switches, the maximum decimal value is 255. When you flip switch 1 and switch 3 on an 8-channel DIP block, you are setting binary 00000101, which translates directly to a decimal 5. Below is the complete reference data, engineered for embedded systems builders, Arduino hobbyists, and ESP32 developers who need to map physical hardware states to software registers.

The Master Binary to Decimal Chart

How to read this table: This chart is based on the fundamental base-2 positional numeral system as defined in ISO/IEC 80000-2 standard digital logic conventions. The Bit Weight column represents the multiplier ($2^n$). To find the decimal value of any binary string, simply sum the Bit Weights for every position where the binary digit is '1'. The Hexadecimal column is included because most C/C++ compilers and datasheets require hex prefixes (e.g., 0xFF) for bitmask operations.

Bookmark Quick-Jumps: The most queried hardware values (8, 16, 32, 64, 128, 255) are tagged with anchor IDs below for fast reference during bench work.
Bit Position ($n$) Bit Weight ($2^n$) Binary (8-Bit) Unsigned Decimal Hexadecimal
010000000110x01
120000001020x02
240000010040x04
380000100080x08
41600010000160x10
53200100000320x20
66401000000640x40
7128100000001280x80
All HighSum(0-7)111111112550xFF
16-Bit & 32-Bit Milestones
825600000001 000000002560x100
10102400000100 0000000010240x400
153276810000000 00000000327680x8000
16 (Max)6553511111111 11111111655350xFFFF
2533,554,432(32-bit register)335544320x2000000
32 (Max)4,294,967,295(32-bit register)42949672950xFFFFFFFF

Architecture Mapping: Which Column Applies to Your Board?

Knowing the math is only half the battle; you must know which column applies to your specific microcontroller architecture. Applying an 8-bit decimal value to a 32-bit register won't break anything, but attempting to write a 16-bit value to an 8-bit hardware port will cause a bitwise overflow, truncating your data and causing erratic hardware behavior.

  • 8-Bit Architectures (Arduino Uno / ATmega328P): Direct port manipulation registers like PORTB and PORTD are strictly 8-bit. Your maximum decimal ceiling is 255. If you are reading an 8-channel DIP switch wired to PORTD, a reading of binary 10100000 translates to decimal 160.
  • 16-Bit Architectures (Timers and ADCs): Hardware timers (like Timer1 on the ATmega328P) and high-resolution Analog-to-Digital Converters operate on 16-bit registers. Your ceiling is 65,535. A 10-bit ADC reading (max 1023) fits comfortably inside this 16-bit column.
  • 32-Bit Architectures (ESP32 / STM32): Modern SoCs use 32-bit wide GPIO registers. According to the Espressif ESP32 Technical Reference Manual, writing directly to the GPIO_OUT_W1TS_REG (Write 1 to Set) requires 32-bit decimal values. To set GPIO 25 high via direct register manipulation, you don't write '25'; you write $2^{25}$, which is decimal 33554432 (or 1UL << 25 in C++).

Signed Integers: How Two's Complement Modifies Base Values

In electrical wire sizing, NEC temperature derating rows modify the base ampacity of a conductor based on ambient heat. In binary conversion, signed integer formats (Two's Complement) act as the 'derating row' that modifies the base unsigned decimal value of a binary string.

If your microcontroller variable is declared as an unsigned int, binary 10000000 equals decimal 128. However, if you declare that same variable as a standard signed int8_t, the most significant bit (MSB) becomes a sign indicator rather than a positive weight. The binary string 10000000 is suddenly 'derated' to decimal -128.

Bench Debugging Tip: If your sensor is returning bizarre negative decimal values when the physical measurement should be positive, check your variable declaration. You are likely reading an 8-bit or 16-bit Two's Complement register into a signed variable when the datasheet specifies an unsigned output, or vice versa.

Binary to Decimal Chart FAQ

How do I convert a 10-bit binary ADC reading to a decimal voltage?

A standard 10-bit ADC (like the one on the Arduino Uno) outputs a decimal range from 0 to 1023. To convert this binary/decimal reading into a real-world voltage, use the formula: Voltage = (Decimal_Reading / 1023.0) * Vref. If your reference voltage (Vref) is 5.0V and your serial monitor outputs a decimal 512, the math is (512 / 1023.0) * 5.0 = 2.50V. Always use 1023.0 (floating point) in your code to prevent integer division truncation.

Why does my I2C address chart show 0x3C in hex but 60 in decimal?

I2C addresses are fundamentally 7-bit binary numbers, but they are almost universally documented in hexadecimal. 0x3C in hex translates to binary 0111100, which is decimal 60. However, be careful with microcontroller libraries. Some I2C libraries (like older Arduino Wire implementations) require the 8-bit shifted address. They take the 7-bit address (0x3C), shift it left by one bit to make room for the Read/Write flag, resulting in 0x78 (decimal 120). Always check your specific library's documentation to see if it expects the 7-bit or 8-bit shifted decimal value.

How do I calculate the decimal value of a 32-bit ESP32 GPIO bitmask?

When configuring multiple pins simultaneously on a 32-bit board like the ESP32, you use bitmasks. If you need to set GPIO 2, GPIO 4, and GPIO 5 high, you look up their bit weights in the chart: 4 ($2^2$), 16 ($2^4$), and 32 ($2^5$). Sum those decimal values: 4 + 16 + 32 = 52. In your C++ code, rather than hardcoding the decimal 52, it is vastly more readable and less error-prone to use bitwise shift operators: (1UL << 2) | (1UL << 4) | (1UL << 5). The compiler resolves this to the exact same binary sequence at build time.