Number Systems
Binary, Decimal and Hex Conversion: A Step-by-Step Guide
Convert between binary, decimal, hexadecimal and octal by hand with clear worked examples, shortcut tables, and code in Python and JavaScript.
Practical, example-driven guides to bitwise operators, binary number systems, and the places bit manipulation shows up in real code, from subnet masks to file permissions. Written by Hamza, creator of Bitwise Calculator.
Showing 1-12 of 12 guides
Number Systems
Convert between binary, decimal, hexadecimal and octal by hand with clear worked examples, shortcut tables, and code in Python and JavaScript.
Algorithms
Practical bit manipulation tricks with explanations: power-of-two checks, lowest set bit, popcount, swapping, sign tests, rounding to powers of two, and subset enumeration.
Programming Languages
Learn Python's &, |, ^, ~, << and >> operators, how unlimited-precision integers affect results, how to emulate 8, 16, 32 and 64-bit math, and useful int methods.
Systems
Understand big-endian and little-endian byte order, why x86 and ARM are little-endian, why networks use big-endian, and how to read and swap bytes safely in C, Python and JavaScript.
Software Design
How to store feature flags and settings as bits in a single integer, with design rules, database queries, versioning tips, and code in C, Python, JavaScript and SQL.
Programming Languages
Understand how JavaScript converts numbers to 32-bit integers for &, |, ^, ~, <<, >> and >>>, why results turn negative, and when to use BigInt for 64-bit masks.
Bit Shifts
Learn the difference between logical (zero-fill) and arithmetic (sign-fill) right shifts, how C, Java, JavaScript and Python handle them, and why -7 >> 1 is -4.
Networking
Learn how routers use bitwise AND with subnet masks to find network addresses, how CIDR prefixes map to masks, and how to calculate broadcast addresses and host ranges.
Number Systems
Learn how two's complement represents signed integers, why ~x equals -(x+1), how to convert by hand, and how overflow and sign extension work, with 8-bit examples.
Systems
Understand Unix permission bits in binary and octal, how chmod numbers are built with bitwise OR, how umask uses AND and NOT, and what setuid, setgid and the sticky bit do.
Bitwise Operators
A practical bit masking tutorial with AND, OR, XOR, and NOT. Learn the four core mask operations with a worked permissions example in C, Python, and JavaScript.
Binary Arithmetic
See where XOR is used in real software: toggling flags, swapping values, parity checks, RAID, checksums, ciphers, graphics, and finding unique elements, with code.