# vim test.bin input the following command into hex mode :%!xxd and the following command is escape from hex mode :%!xxd [ref : http://www.linuxinstead.com/blog/2009/04/21/using-vi-as-a-hex-editor ]