endianness? big endian? little endian?

I’m going to be writing an NTP client of sorts and I’m wondering the endianness of arduino. I wrote a test sketch to check endianness but I wont be able to run it until tomorrow when I get home :-/

void setup () {
  uint8_t packet_buffer[64];
  uint8_t packet_buffer_len=48;
  uint32_t* variable = (uint32_t*)(packet_buffer);
  uint32_t timestamp = ((packet_buffer[40] << 24) + (packet_buffer[41] << 16) + (packet_buffer[42] << 8) + (packet_buffer[43]));
  Serial.print("Machine Endian: ");
  Serial.print("Big Endian: ");
void loop() {


since NTP-Clients are usally tied to a network-layer, the use Network-(i.e. Big Endian) byteorder anyway. Eberhard

Since the AVR doesn't have any registers over 8 bits, it doesn't really have a native endianness. (hmm. Check Data sheet. The AVR has Two instructions ADIW and SUBIW, that operate on "register pairs" in a manner that is blatantly little endian. Sort of, since those only work on register address space, and "endianness" usually refers to what happens when you copy data larger than a byte from memory to register(s)) However, the compiler certainly has an endianness that it uses for moving ints and longs to and from memory, even if the processor is agnostic. GCC (used by Arduino) seems to be little-endian by default. There IS a compiler switch you can use to specify endianness on cpus that can operate either way, but I don't know whether it does anything on AVRs...)