Binary Decimal Hex Converter
Convert binary, decimal, hex, octal, and Base36 integers with signed-width checks, bit fields, endian previews, and byte-level output.Base Conversion Result
| Metric | Value | Copy |
|---|---|---|
| {{ row.label }} | {{ row.value }} |
| Area | Assessment | Recommendation | Copy |
|---|---|---|---|
| {{ row.area }} |
{{ row.severity }}
{{ row.status }}
|
{{ row.recommendation }} |
| Register metric | Value | Copy |
|---|---|---|
| {{ row.label }} | {{ row.value }} |
| Bit | State | Weight | Nibble (LSB=0) | Byte (LSB=0) | Role | Copy |
|---|---|---|---|---|---|---|
| {{ row.bit }} | {{ row.state }} | {{ row.weight }} | {{ row.nibble }} | {{ row.byte }} | {{ row.role }} |
| Width | Selected mode | Signed | Unsigned | Hex | Status | Copy |
|---|---|---|---|---|---|---|
| {{ row.width }} | {{ row.selected }} | {{ row.signed }} | {{ row.unsigned }} | {{ row.hex }} | {{ row.status }} |
| Offset | Hex | Dec | Binary | ASCII | Copy |
|---|---|---|---|---|---|
| {{ row.offset }} | {{ row.hex }} | {{ row.dec }} | {{ row.bin }} | {{ row.ascii }} |
| Window | Visible bytes | Big-endian read | Little-endian read | Takeaway | Copy |
|---|---|---|---|---|---|
| {{ row.window }} | {{ row.bytes }} | {{ row.big }} | {{ row.little }} | {{ row.takeaway }} |
| Field | Value | Copy |
|---|---|---|
| {{ row.label }} | {{ row.value }} |
Introduction:
Low-level numbers often arrive as whatever notation made sense at the moment they were recorded. A register map may show hex, a permissions note may use octal, a packet trace may expose bytes, and a developer ticket may quote the same value in decimal because people read it faster. The notation is only the written shape. The underlying integer, the stored bits, and the signed reading can still be different questions.
That difference matters as soon as a value has to fit into a fixed number of bits. Unlimited arithmetic can keep growing, but real fields usually cannot: 8 bits for a byte, 16 bits for a short word, 32 bits for many integer values, 64 bits for larger counters, and wider windows for identifiers or packed payloads. A value that is harmless as a decimal count may wrap when it is forced into one of those spaces.
| Notation | Digits | What it makes easy to see |
|---|---|---|
| Binary | 0 and 1 |
Every bit, flag, mask, sign bit, and bit-field boundary. |
| Octal | 0 through 7 |
Three-bit groups, especially in legacy permissions and old system notes. |
| Decimal | 0 through 9 |
Human-facing counts, limits, IDs, and documentation values. |
| Hexadecimal | 0 through 9, A through F |
Bytes and words, because one hex digit represents four bits. |
| Base36 | 0 through 9, A through Z |
Compact human-readable IDs after the value has already been parsed. |
The common failure is treating a display format as a storage rule. 0xAC, 172, and 1010 1100 can all describe the same byte. Read that byte as unsigned and it is 172. Read it as signed 8-bit two's complement and it is -84. The base tells you how the digits were written; the width and sign rule tell you what the bit pattern means.
Byte order adds another practical trap. Big-endian notation puts the most significant byte first, which matches ordinary written numbers. Little-endian notation puts the least significant byte first, which is common in memory dumps and binary file work. A single byte reads the same either way, but a multi-byte sequence can produce a completely different decimal value when the byte order is reversed.
Reliable conversion keeps four facts together: source base, register width, signedness, and byte order. A copied hex string can be syntactically correct and still be the wrong value for a firmware note, protocol field, test fixture, or debugging session if one of those facts is missing.
How to Use This Tool:
Start with the literal exactly as you found it, then lock down the assumptions that came with the source system.
- Paste one value into
Integer literal. Spaces, underscores, commas, and apostrophes are ignored, so0xDEAD_BEEFand0xDEADBEEFparse the same way. If the paste contains several lines, the converter uses the first non-empty literal and warns that the rest were ignored. - Choose
Base.Auto detectreads0b,0o, and0xprefixes, treats bare zero-one strings such as1010as binary, and treats digits withAthroughFas hex. Pin Binary, Octal, Decimal, or Hexadecimal when a note or ticket needs one exact reading. - Set
Interpretation mode. UseUnsignedfor masks, raw bytes, flags, and counters. UseSignedwhen the source says the field is a two's-complement integer. LeaveAutoonly when following the sign of the typed value is acceptable. - Select
Bit-width model. Native width gives the smallest useful display. Fixed widths from 8 to 256 bits, plus custom widths from 2 to 4096 bits, match real register windows and expose wrap. - Open
Advancedfor dump-matching details. Set digit grouping, byte order preview, printable-byte policy, prefixes, hex letter case, zero padding, optional two's-complement steps, and bit-field extraction. - Use
Conversion Checksas the stop sign. Correct invalid digits, a prefix/base conflict, a custom width outside 2 to 4096 bits, selected-mode overflow, or a clamped bit-field window before copying the result.
After the main conversion looks right, use Register View for range and overflow facts, Bit Map for individual bit positions, Width Ladder for clean-width comparison, Byte Stream for byte inspection, and Endian Audit when the value came from memory, a packet, or a binary file.
Interpreting Results:
Start with the summary badges. They show the interpreted decimal value, abbreviated hex and binary forms, detected base, active sign mode, active width, set-bit count, and wrap status. If the wrap badge says Wrap occurred, the selected register width changed the value under the selected sign rule.
Base Conversions separates the original mathematical value from fixed-register readings. Parsed decimal (signed) is the value described by the literal. Register value (unsigned) is the stored pattern read as magnitude. Register value (signed two's complement) reads the same pattern with the top bit as the sign bit.
Conversion Checks protects against correct-looking mistakes. A parsing warning means the source base may not match your intent. A width warning means the chosen register size wrapped the value. An endian warning means the same visible bytes can read differently in big-endian and little-endian order.
A matching hex string is not enough proof. For 0xFF, the correct explanation may be unsigned 255, signed -1, an all-set mask, or eight enabled flags. Confirm the signed decimal row, active register width, field extraction window, and byte order before using the value in code, documentation, or a test fixture.
Technical Details:
Integer bases are positional numeral systems. Each digit has a value and a position, and the base decides the weight of each position. Binary uses powers of 2, octal uses powers of 8, decimal uses powers of 10, hexadecimal uses powers of 16, and Base36 uses ten digits plus the letters A through Z for compact display.
Hexadecimal is common in low-level work because it aligns cleanly with binary. One hex digit represents four bits, so two hex digits represent one byte. Octal aligns with three-bit groups, which explains its older use in permission bits and machine notation. Decimal does not align to bit groups, but it remains the easiest form for counts and ordinary documentation.
Formula Core
For a digit string in base b, the integer value is the sum of each digit times its positional weight. The rightmost digit has position 0.
For 0xAC, base 16 gives A as 10 and C as 12. The value is 10 x 16^1 + 12 x 16^0 = 172. Written in binary, 172 becomes 1010 1100; written as an 8-bit signed two's-complement value, that same bit pattern is negative because the top bit is set.
Transformation Core
Fixed-width conversion adds a register step after the literal is parsed. The mathematical integer is reduced into the active register space, then the stored unsigned pattern can be read as signed or unsigned.
Here V is the parsed integer, N is the active bit width, U is the stored unsigned register value, and S is the signed two's-complement reading. Unsigned range is 0 to 2^N - 1. Signed range is -2^(N - 1) to 2^(N - 1) - 1.
| Choice or output | Technical effect | Check before relying on it |
|---|---|---|
| Native width | Uses the minimum useful bit count for the parsed value and selected sign path. | Good for compact conversion, but it may not match a real register or protocol field. |
| Fixed width | Uses an 8, 16, 32, 64, 128, 256, or custom 2 to 4096 bit register window. | Check Overflow for selected mode and Width Ladder. |
| Two's-complement signed reading | Treats the top bit as negative weight when it is set. | Compare Register value (unsigned) and Register value (signed two's complement). |
| Bit-field extraction | Reads a slice starting at Field LSB for the requested bit width, clamped to the active register. |
Use the reported Field extraction window and Field mask. |
| Byte order preview | Reorders visible bytes for byte inspection and endian comparison. | It does not change the parsed integer, but it can change a multi-byte reading. |
Bit numbering in the bit map starts at the least significant bit as bit 0. Nibble and byte labels are also based on that least-significant-bit numbering. Endian review should stay separate from bit numbering: big-endian and little-endian change byte order in a multi-byte value, not the order of bits inside each byte.
Display grouping is only formatting. Nibble, byte, and word grouping make long binary, octal, and hex strings easier to read, while prefixes and uppercase hex help copied values keep their context. Base36 is produced as another written form of the parsed integer. None of those display choices changes the parsed integer or the fixed-width register pattern.
Advanced Tips:
- Use an explicit
Basefor documentation and code review.Auto detectis convenient for mixed paste work, but a pinned base prevents1010from being read as binary when it was meant as a decimal ID. - Keep
Zero-pad to widthon when comparing registers. Padding makes missing high bits visible, which helps catch a 16-bit value accidentally being compared with an 8-bit dump. - Turn on
Show two's complement stepsfor negative signed values. The extra rows give a short audit trail from stored bits to decoded magnitude. - Use
Field LSBandField widthfor packed flags, then copy the reportedField maskwhen you need to reproduce the extraction in notes or code. - Change
Non-printable bytesto\xNNwhen byte identity matters. Dots are easier to scan, but escape form is safer when control bytes, nulls, or separators are part of the evidence.
Worked Examples:
One byte, two decimal readings
Enter 0xAC, leave Base on Auto detect, choose Signed, and set an 8-bit width. Parsed decimal (signed) is 172 because the literal is positive, while Register value (signed two's complement) is -84 because the stored byte has its top bit set. The Bit Map marks that sign bit before you copy either decimal reading.
Binary-looking decimal text
Paste 1010 with Base set to Auto detect. Because the value contains only zeroes and ones, Resolved base reports Binary and the parsed decimal value is 10. If the intended value is one thousand ten, set Base to Decimal and confirm the parsed decimal row changes to 1,010.
Negative value in a byte register
Enter -42, choose Decimal, select Signed, set 8-bit width, and turn on Show two's complement steps. The stored unsigned value is 214 and the hex output is 0xD6 when prefixes and uppercase hex are on. The signed reading remains -42, and the two's-complement rows show the source bits, inverted bits, and decoded magnitude.
Endian-sensitive word data
Enter 0x12345678, choose Unsigned, and set 32-bit width. In big-endian byte order the visible bytes are 12 34 56 78. In little-endian preview they appear as 78 56 34 12. Endian Audit shows that the full visible byte window can read as different decimal values depending on byte order, so copy the reading that matches the source system.
Extracting the high byte of a mask
Enter 0xFF00, choose unsigned 16-bit, set Field LSB to 8, and set Field width to 8. Field mask matches the high byte, the extracted binary field is all ones, and the extracted unsigned field is 255. If the requested slice extends past the active register, Conversion Checks reports that the field window was clamped.
FAQ:
Why did auto-detect treat 1010 as binary?
Auto detect treats a bare string made only of zeroes and ones as binary. Select Decimal when bare digits such as 1010 should mean a decimal count.
Why can one hex value have two decimal readings?
A fixed-width bit pattern can be read as unsigned magnitude or signed two's-complement. Compare Register value (unsigned) with Register value (signed two's complement) to see both readings.
Does changing byte order change the integer I entered?
No. Byte order preview changes the byte inspection order and the endian audit readings. It does not change the parsed integer or the stored register pattern.
What should I do when the converter reports wrap?
Check Overflow for selected mode and then open Width Ladder. The ladder shows which standard widths preserve the original signed or unsigned value.
Are pasted values sent away for conversion?
The conversion runs in the browser after the page loads. Avoid sharing a URL that includes sensitive literals or settings, because those values may be visible to anyone who receives that URL.
Glossary:
- Base or radix
- The number of digit values available in a positional numeral system, such as 2 for binary or 16 for hexadecimal.
- Integer literal
- The written form of a whole number, including any sign, prefix, digits, and visual separators.
- Register width
- The number of bits used to store or inspect the value, such as 8-bit, 32-bit, or a custom width.
- Two's complement
- A common signed-integer reading where the top bit marks negative values in a fixed-width register.
- Endian
- The byte order used when a multi-byte value is stored, displayed, or transmitted.
- Nibble
- A four-bit group, equal to one hexadecimal digit.
- Bit field
- A selected slice of bits within the active register, often used for flags, packed values, or protocol fields.
References:
- Java Language Specification, Chapter 3, Lexical Structure, Oracle, Java SE 26.
- Endian (Big Or Little), National Institute of Standards and Technology, 2023.
- Positional numeral system, Encyclopaedia Britannica.
- How to send binary data with cURL, Simplified Guide.