 <p>A byte is a signed value held in 8 bits and may be in the range -128 to 127.</p> <p>The left most bit is used as the sign bit.</p> <p><code>System.out.println(-20 &amp; 0xFF);</code> has nothing to do with bytes, this is an int operation.</p> <p>The binary representation of -20, as a byte is: 1110_1100</p> <p>1110_1100 &amp; 1111_1111 = 1110_1100</p> <p>If you want unsigned, there's char to play with, but you're not going to be happy. Realistically, Java doesn't have unsigned.</p> <p>Negatives are stored in '2s Complement' form, eg:</p> <p>1111_1111 == -1</p> <p>But why?</p> <p>Under 2s complement to make a negative number, all the bits are flipped (1s complement) and 1 is added (making 2s complement - two operations)</p> <p>So</p> <pre><code> 0000_0000 - Zero -0000_0001 - minus one --------- 1111_1110 - Ones complement - (this would be xor 1111_1111) +0000_0001 - plus one - we're converting to 2s complement, not doing math --------- 1111_1111 - -1 in 2s complement </code></pre>