Let's say that you have the decimal number 12345678. In hexadecimal, that is BC614E. You most likely want to use this as a 32-bit number, so let's write it as 4 bytes (since 32 bits = 4 bytes): 00 BC 61 4E.
Now that you have a hexadecimal number expressed as bytes, here's how to swapping the endianness, either from little to big or from big to little. Take the number 00 BC 61 4E and write the bytes in the reverse order: 4E 61 BC 00. (Important: Not E4 16 CB 00!) If you wanted the number in hexadecimal, you're done now. Otherwise, you have to convert back to decimal. 4E 61 BC 00 in decimal is 1315027968.
Now that you have a hexadecimal number expressed as bytes, here's how to swapping the endianness, either from little to big or from big to little. Take the number 00 BC 61 4E and write the bytes in the reverse order: 4E 61 BC 00. (Important: Not E4 16 CB 00!) If you wanted the number in hexadecimal, you're done now. Otherwise, you have to convert back to decimal. 4E 61 BC 00 in decimal is 1315027968.
