 <p>BitConverter class should help you.</p> <p><a href="https://msdn.microsoft.com/en-us/library/a5be4sc9(v=vs.110).aspx" rel="nofollow">BitConverter.GetBytes</a></p> <p>Something like this:</p> <pre><code>float f = 1234.5678F; var bytes = BitConverter.GetBytes(f); var result = string.Format("0x{0:x}{1:x}{2:x}{3:x}", bytes[0], bytes[1], bytes[2], bytes[3]); </code></pre>