Hex/Binary Editor

  • Im aware of the various plugins available and the issues related to using them but surely, given this text editor is used by a lot of programmers it would seem sensible to assume that a hex editor or binary editor would be a logical native addition to the program.

    I cant see it being a massive headache to implement this, even if its just a viewer that gets added without any of the commonly used hex/binary tools.

    There are converters to go from various character sets or encodings so why not offer a converter which converts the data into a binary view?

    Something…anything…please :)


  • Maybe a lot of other programmers (read contributers) can see it’s a massive headache to implement and even more important maintain a hex/binairy editor/viewer. Especially when there are suitable alternatives available for free.

  • can see it’s a massive headache to implement

    Especially when the underlying scintilla control work against it. (try to get 0x00 from calls like getText)

    but @tom-shaw
    if you are just looking for a hexadecimal representation like this

    than a simple python script could do what you want.


  • Hi, @claudia-frank

    Oh yes ! Interesting suggestion, indeed ! I’m not speaking about the numerous free Hex editor, available on Net, with specific features !

    No, Claudia, I’m thinking about a very simple job :

    Given the present location of the caret, your ( future ! ) Python script would just give us, in a new window, the hexadecimal representation of, let say, the 256 following characters !

    So, even, in case of characters, with code-point over \x{FFFF}, in an UTF-8 encoded file, the maximum amount of bytes, to be displayed, would be 1024 ( in 64 lines * 16 columns or 32 lines * 32 columns )

    And, in case of an user selection of text, limited to 256 characters, again, it would act, also, as above !

    Of course, Claudia, you’re free to choose the limits as you like ! May be, @scott-sumner, are you interested by this goal ? But, please, it’s not a competition between you both ;-))



  • @guy038

    Guy, if you say a new window do you refer to the same functionality as in regex tester meaning
    having the second view holding the hex view of doc in first view? Like

    or really to a new window like


    Concerning selection, I assume, it isn’t that easy because scintilla doesn’t return 0x00 instead it
    returns 0x20 - is a known “feature” of scintilla. To work around this feature one must read the
    binary file, hold in memory and then try to map the selected text to the real data from file.
    So this means, live editing of binary file isn’t easily solvable - it must always be saved to refelect
    the hex view correctly.

    But I admit, it is an interesting project.


  • Hello, @claudia-frank,

    Thanks for your quick reply :-)) Don’t worry, Claudia ! I just thought about viewing hex contents of previously saved files, of course !

    And I do like the Regex Tester’s solution, with automatic creation of a new file, with the hex contents, in the secondary view, for easy comparing with the file, itself !

    It should be useful, sometimes, when downloading files form Net, to find out which exotic characters are in. It could help us, also, to see all the bytes, used by specific character(s), according to the current encoding of the file !

    But, please, just take your time ! Just an other Python exercise, for fun :-))



  • @guy038 , @Claudia-Frank :

    Good ideas, all! Maybe for those that don’t do Pythonscript (and thus won’t benefit when Claudia cranks out her upcoming P.S. hex-viewing masterpiece!), my current solution to this problem may be of interest: Get “HxD” and then create a “Run” menu option called “Launch current file in HxD hex editor”. :-D


    BTW, (and I’m surprised this hasn’t come up earlier in this thread), I’ve tried the “official” Notepad++ Hex Editor plugin several times over the course of my Notepad++ lifetime, and I’ve never been able to get it to do anything but give some sort of exception error message. :(

  • @Scott-Sumner

    good one and yes, this is my default hex editor as well - brilliant piece of software.


  • TextFx has some “Convert text to hex” commands.

  • @Claudia-Frank @guy038 @Scott-Sumner


    Only problem is Im a c++/javascript guy and not a python guy…

    I like snakes too!

    Im actually after a binary representation of a file…Im working with lots of sensor cells so it might just be that it would be simple to write that in js. I was just trying to avoid having to write more code :(

    In that case we could always debate js vs Python because the last time I had a code argument was perl vs php. Its funny, all these languages get closer and closer to each other and eventually well end up with malloc statements and vectors and the std library :)

    Thanks for the replies and I think I need to write the tool to view the data in a browser so I might as well just write that first because its going to be handy to have.

    Unless there s a HxD (which is excellent btw) :)


Log in to reply