Scenario
A feature flag arrived in a bug report as 0b101101, the code review discusses 0x2D, and the database column stores 45. Three people are arguing about whether these are the same flag or three different ones. Converting binary to hex or hex to decimal in your head is exactly how off-by-one-bit mistakes ship, so prove the equivalence before anyone edits the flag.
Broken input
0b101101
0x2D
45
Goal
Use Binary / Hex / Decimal Converter to confirm whether the binary, hexadecimal, and decimal versions represent the same exact integer. If they match, the bug is elsewhere; if they differ, you have found where a copied constant changed meaning.
Tool sequence
- Open Binary / Hex / Decimal Converter.
- Enter
101101as binary — the converter treats the0bprefix as notation, so drop it if the tool flags it as an invalid digit. - Read the decimal and hexadecimal fields the converter fills in, then repeat with
2Das hex and45as decimal. - If any of the three entries lands on a different decimal value, that entry is the corrupted one — check whether a digit was dropped or a prefix misread.
- If the flag feeds a signed field or a permission mask, continue in Two's Complement Calculator or Bitwise Operations Calculator.
Checkpoint output
binary 101101
decimal 45
hex 2D
All three inputs converge on the same integer, so the flag value is consistent across the bug report, the review, and the database.
Common mistakes
- Dropping a prefix before you know which base the original value used —
101101read as decimal is one hundred one thousand, not 45. - Treating a grouped binary display like
10 1101as if the spaces are part of the value. - Assuming a plain number in a bug report is decimal when the surrounding code writes flags in hex.
- Converting one value and eyeballing the other two instead of running all three through the same converter.
Related tools and lessons
- Two's Complement Calculator - Convert signed decimals to fixed-width binary and back.
- Bitwise Operations Calculator - Evaluate AND, OR, XOR, NOT, and bit shifts by width.
- ASCII / Unicode Explorer - Inspect characters, code points, bytes, and escapes.
- Related lesson: Decode a Negative Integer from Fixed-Width Binary
- Related lesson: Debug a Bitmask Permission Check