OR Hex Numbers
Perform bitwise OR on two hexadecimal numbers and see the result in hex, decimal, and binary.
Drop two hex values in, hit OR, and get the combined result back in hex, decimal, and binary at once. Handy for merging bitmasks, flipping on feature flags, or checking what 0xA0 | 0x0F actually works out to without pulling up a dev console. And everything runs in your browser. Nothing gets uploaded.
How to Use
Enter the first hex number in the Hex A field. The 0x prefix is optional.
Enter the second hex number in the Hex B field.
Click OR or keep Live mode on to see the bitwise OR result instantly in hex, decimal, and binary.
Copy any result format by clicking the Copy link below it.
Frequently Asked Questions
What is a bitwise OR operation?
Bitwise OR compares each bit of two numbers and produces a 1 if either or both bits are 1, and a 0 only if both bits are 0. In a truth table: 0 OR 0 = 0, 0 OR 1 = 1, 1 OR 0 = 1, 1 OR 1 = 1. It is one of the fundamental logic operations used in computing and digital electronics.
How does OR work on hex numbers?
Each hex digit represents 4 binary bits. The OR operation is applied bit by bit across the two numbers. For example, 0xA0 OR 0x0F: A0 = 10100000, 0F = 00001111, OR = 10101111 = AF. This is commonly used to set specific bits in a value by OR-ing with a bitmask.
What are common uses of bitwise OR?
Bitwise OR is widely used in programming for setting flags and combining bitmasks. For example, file permissions (read|write = 6), feature flags, hardware register configuration, and combining options in API calls. It is also used in graphics programming for color manipulation and in network protocols for combining IP addresses with subnet masks.
Does this handle numbers of different lengths?
Yes. If the two hex numbers have different lengths, the shorter one is effectively padded with leading zeros. For example, OR-ing "F" with "FF00" treats the first value as "000F". The result will have at least as many hex digits as the longer input.
Can I use the 0x prefix?
Yes. The tool automatically strips any 0x or 0X prefix before processing. You can enter "0xFF" or "FF" interchangeably. Results are always displayed without the prefix for clarity and easy copying.