xxd

Make a hexdump (hexadecimal data) or do the reverse.
— man xxd

How to print first 32 bytes of file in hex format.
xxd -l 32 -p <filename>

How to revert a plaintext hexdump from xxd (xxd -p input_file) back into binary, and save it as a binary file?
xxd -r -p input_file output_file

You can also able to integrate xxd with vim :h hex-editing.