Thanks everyone, I solved the problem. I didn't understand these bitmanip methods so I searched and found a function to do what I wanted: string b = "\x24\x10\x00\x00"; uint i = byteToInt(b); uint byteToInt(string b) { return b[0] | b[1] << 8 | b[2] << 16 | b[3] << 24; } => 4132