What you need is the -c option.
# echo -n "this is a long line and xxd will print it as one line" | xxd -p -c 1000000
746869732069732061206c6f6e67206c696e6520616e64207878642077696c6c207072696e74206974206173206f6e65206c696e65
Here is some info from the documentation:
  -c  cols  | -cols cols format  octets per line. Default 16
                (-i: 12, -ps: 30, -b: 6). Max 256.
Documentation says that the max value for "c" parameter is 256, but I tried greater values and it worked. Check it out:
# xxd -c 1000000 -p -l 1000000 /dev/urandom | wc -c
2000001
Here I dump one million bytes from /dev/random and I get a string of 2 million + 1 characters. Each byte from /dev/random is represented by 2 characters and additional byte is the final newline.
     
    
trto delete the newlines, e.g.... | xxd -p | tr -d \\nxxdis that it ignores whitespace for the reverse-rof its postcript/plain-pdump (or any plain hexdump for that matter). eg. The following line wraps with\n, but the reversed output is exactly what was input:echo {1..14} | xxd -p | xxd -p -rproduces output:1 2 3 4 5 6 7 8 9 10 11 12 13 14\n– the\nis from theechohexdump -v -e '/1 "%02X"'instead ofxxd.tr -d '[[:blank:][:space:]]'.xxd -pintoxxd -p -c 0to make it single-line. (I posted it as an answer, but got removed because included in more complex answers…)