Swap endianness
Reverse byte order within fixed-size words: flip a file between little- and big-endian.
Runs on your device. The file is never uploaded.
Swap endianness reverses the byte order inside each fixed word, writing the result with -swapped before the original extension. wordSize takes 2, 4 or 8, defaulting to 4, so bytes 0 to 3 come back as 3, 2, 1, 0. A trailing group too short for a full word is copied through unchanged, never padded or dropped.
Questions
What exactly does it swap?
The byte order inside each fixed-size word. With wordSize 4, the default, bytes 0 to 3 are written back in the order 3, 2, 1, 0, then bytes 4 to 7, and so on to the end. It does not reverse the file and it does not reorder words relative to each other. Choose 2, 4 or 8 to match the field width of the data you are looking at.
What happens if my file is not a multiple of the word size?
The leftover bytes are copied through unchanged, and the tool tells you so with a note that a trailing count of bytes did not form a full word and were left unchanged. They are not padded and not dropped, because either choice would change the file length or invent bytes that were never there.
What is the output file called?
Your file's name with -swapped inserted before the extension, keeping the original extension, or .bin if the name had none. data.raw becomes data-swapped.raw. Nothing else about the file changes, so the output is exactly as long as the input and holds exactly the same bytes in a different order within each word.
Will this fix a file that opens as garbage?
Only if the cause was byte order, which is common with raw dumps from a device of the opposite endianness and with 16-bit audio or sample data. It cannot fix truncation, corruption or a wrong offset. Swap it, then run Detect file type or Hex viewer on the result; if a known signature appears, the byte order was the problem.
Is it reversible?
Yes. Running it again with the same word size gives back the original bytes exactly, including any trailing partial word. That makes it safe to try each of 2, 4 and 8 on a copy and keep whichever produces something recognisable.