Converting hexadecimal to IEEE 754
<p>If I use a website like <a href="http://www.h-schmidt.net/FloatConverter/IEEE754.html" rel="nofollow">http://www.h-schmidt.net/FloatConverter/IEEE754.html</a> to convert the hex string <code>'424E4B31'</code> into float32, I get 51.57343.</p>

<p>I need to use Python to convert the string, however, using solutions on StackExchange like:</p>

<pre><code>import struct, binascii
hexbytes = b"\x42\x4E\x4B\x31"
struct.unpack('&lt;f',hexbytes)
</code></pre>

<p>or </p>

<pre><code>struct.unpack('f', binascii.unhexlify('424E4B31'))
</code></pre>

<p>I get 2.9584e-09... why is it different?</p>

<p>Because endianness is a thing.</p>

<pre><code>&gt;&gt;&gt; struct.unpack('&gt;f',hexbytes)
(51.573429107666016,)
</code></pre>

python ieee-754