Bitmask Calculator
Calculate, visualize, and combine bitmask/flag values.
Decimal
255
Hex
0xFF
Binary
11111111
Octal
0o377
Bit toggles (8 bits set) — click to toggle
Examples
| Input | Result |
|---|---|
| 255 (decimal) | Hex: 0xFF, Binary: 11111111, Octal: 0o377, 8 bits set |
| 0xF0 (hex) | Decimal: 240, Binary: 11110000, 4 bits set |
| 42 OR 15 | 42 | 15 = 47 (decimal), Binary: 00101111 |
| Toggle bit 3 on value 8 | 8 XOR 8 = 0 (bit 3 cleared) |
About this tool
Enter a value in decimal, hex, or binary and see it displayed in all common number bases. Click individual bits to toggle them on or off. The tool supports 8-bit, 16-bit, and 32-bit widths.
You can also combine values using AND, OR, XOR, and NOT operations. This is useful for working with permission flags, hardware registers, network masks, or any situation where you need to manipulate individual bits.
Frequently asked questions
What is a bitmask?
A bitmask is a value where individual bits represent flags or options. Each bit position acts as a boolean switch. Bitmasks are used in permissions systems, feature flags, hardware registers, and network protocols.
What bitwise operations are supported?
AND (keeps bits set in both values), OR (sets bits from either value), XOR (toggles bits that differ), and NOT (inverts all bits).
Can I toggle individual bits?
Yes. Click any bit in the visual display to flip it between 0 and 1. The decimal, hex, binary, and octal representations all update in real time.
