Convert any file into a binary file and vice versa

与世无争的帅哥 提交于 2019-12-05 13:16:34

The thing is, that all the files are already are binary, you just need any HEX viewer to see them properly, as they are. For instance, you can use "Compare by content" from Total Commander).

There is no-"no binary" files in the computer world.

HEX means base 16 system, you can easily convert it to 2 based (1,0), by using simple windows calculator in Programmer mode:

In the picture below, a text file has been compared by itself, using Binary switch, just to show it's content in HEX way, and first digit is "66", we place it into calculator when HEX mode is activated and then switch to BIN, and have 1100110 - this for letter "f" and so on.

P.S.#1. Interesting thing is that there is no real emphasis on this matter in Wikipedia nor other sites, I think this is totally confusing for people who don't know this already, I think they should have the word binary in the first line of definition of the computer file.

A computer file in its deepest level is binary data, not a piece of information in lines and some different (from binary) formats. The file format is only a protocol to store bytes and information it becomes only when it has been read or opened by someone or something in understandable way, meaning that the user, or client software knows how that data (bytes) has been written in this particular file.

P.S.#2. WTF? - Wikipedia has split files to binary and non-binary! Thank God I don't need to read this.


Software to create text representatives from binary input and vice versa: Windows, Online

DiegoRG

This method works with bash terminal

  • Convert your file to hexadecimal

    $ xxd originalFile > hexaFile
    
  • Convert back your hexadecimal file to original

    $ cat hexaFile |  xxd –r > backOriginalFile
    
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!