convert hex string into byte array in python import binascii hex_string = "4CED8879" str = binascii.unhexlify(hex_string) byte_array = [ord(x) for x in s] print (byte_array) Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.