Convert any file to formatted string of hex characters #!/usr/bin/bash hexdump -v -e '16/1 "_x%02X" "\n"' $1 | sed 's/_/\\/g; s/\\x //g; s/.*/ "&"/' The output can then be copied and assigned to a const char * in a header/source file and referenced as a normal string.