Binary Decimal Hex Converter
Convert one integer from binary or other common bases, then inspect Base36 output plus exact signed-width and bit-field interpretations.{{ summaryTitle }} · {{ summaryValue }} · {{ summaryLine }} · {{ summaryBadgeText }}
| Representation | Value | Interpretation | Copy |
|---|---|---|---|
| Correct the literal to restore conversion rows. | |||
| {{ row.label }} | {{ row.value }} | {{ row.note }} | |
| Offset | Hex | Unsigned | Binary | ASCII | Set bits | Copy |
|---|---|---|---|---|---|---|
| Correct the literal to restore byte rows. | ||||||
| {{ row.offset }} | {{ row.hex }} | {{ row.unsigned }} | {{ row.binary }} | {{ row.ascii }} | {{ row.set_bits }} | |
The digits written on a screen do not fully describe an integer. The radix says what each position is worth, while register width and signedness say how a fixed set of bits should be read. The byte pattern AC, for example, is decimal 172 when unsigned but −84 when the same eight bits are interpreted as two's complement.
Base conversion is useful when moving between source code, protocol fields, memory dumps, device registers, and documentation. Binary exposes individual bits, hexadecimal groups them four at a time, octal groups them three at a time, decimal suits ordinary arithmetic, and Base36 provides a compact alphanumeric spelling. These notations can represent the same mathematical value, but a fixed-width register can also wrap that value into a different signed or unsigned reading.
| Base | Digits | Useful relationship |
|---|---|---|
| 2 | 0–1 | One digit per bit |
| 8 | 0–7 | Three bits per octal digit |
| 10 | 0–9 | Ordinary decimal notation |
| 16 | 0–9, A–F | Four bits per hexadecimal digit |
| 36 | 0–9, A–Z | Compact display of the selected decimal reading |
Prefixes such as 0b, 0o, and 0x remove ambiguity. Without a prefix, a string containing only zeroes and ones is auto-detected as binary; other digit-only text defaults to decimal unless a source base is pinned. That rule is convenient for quick work but should not replace a protocol or register specification.
How to Use This Tool:
Enter one integer and make its source notation explicit before choosing how the bits should be interpreted.
- Paste one Integer literal. Spaces, commas, underscores, and apostrophes inside the literal are ignored; extra nonblank lines are reported and not converted.
- Choose Source base. Keep Auto detect only when prefixes or the documented digit rule make the source unambiguous.
- Select signed, unsigned, or sign-aware interpretation and a native, standard, or custom Register width. A custom register may contain 2 to 4,096 bits.
- Use byte order and bit-field controls when reading a protocol or register. Set the least-significant bit position, field width, and signedness from the external definition.
- Read the parsed decimal value separately from the stored register readings. Resolve any wrap or clipped-field warning before copying a representation.
Interpreting Results:
Parsed decimal is the exact mathematical value of the input literal. Register unsigned and Register signed are two readings of the selected fixed-width bit pattern. If a wrap warning appears, the mathematical input did not fit that register even though a bit pattern can still be shown.
Changing byte order reverses the byte stream preview; it does not change the integer or its register bits. A bit-field result is only the requested window inside that register. When the requested field reaches beyond the most significant bit, its effective width is shortened and a warning records the boundary.
Technical Details:
A positional numeral adds each digit multiplied by a power of its base. Parsing uses exact integer arithmetic, so values are not rounded to ordinary floating-point precision. The literal may contain up to 8,192 characters, but the selected register is bounded to 4,096 bits.
Formula Core:
For digits di in base b, the mathematical value is:
An N-bit register stores the value modulo 2N. The signed reading subtracts 2N when the top bit is set.
Unsigned values fit from 0 through 2N − 1. Signed two's-complement values fit from −2N−1 through 2N−1 − 1. Values outside the selected interval wrap, but the warning preserves the distinction between the input and stored reading.
Transformation Core:
| Stage | Exact behavior |
|---|---|
| Resolve base | A matching prefix wins; otherwise letters A–F imply hexadecimal, a zero-one-only string implies binary, and other unprefixed digits imply decimal. |
| Choose width | Native width is the minimum needed for the selected signedness. Fixed choices are 8, 16, 32, 64, 128, and 256 bits; custom width is 2 to 4,096 bits. |
| Store bits | The mathematical value is reduced modulo 2N, then read as both unsigned and two's complement. |
| Extract field | The register is shifted right by the field's least-significant-bit position and masked to its effective width. Optional signed reading applies two's complement within that field. |
| Arrange bytes | The padded register is split into bytes from most significant to least significant. Little-endian preview reverses that byte list only. |
ASCII preview maps byte values 32 through 126 to printable characters. Other bytes appear as a dot or as a hexadecimal escape. Prefixes, uppercase hexadecimal, digit grouping, and zero padding change display only; they do not alter the stored value.
Worked Examples:
Signed byte from a decimal value
With decimal -42, signed interpretation, and an 8-bit register, modulo storage produces binary 11010110 and hexadecimal D6. The unsigned reading is 214, while the signed reading remains −42. Both describe the same eight stored bits.
Protocol field inside a word
For a 16-bit register, setting Field LSB to 8 and Field width to 8 extracts the high byte. Switching the byte preview to little-endian does not change that field value; it only changes which byte is displayed first in the stream.