386

I need a good hex editor for Linux, and by good I mean:

  • Fast
  • Has search/replace features
  • Can display data not only in hex, but also binary, octal, etc.
  • Can work with huge (> 1 GB) files without becoming slow and unresponsive (this requirement is important)
  • Optionally, has some compare/diff features

What can you suggest?

13
  • 21
    For Ubuntu: jeex (GTK), okteta (KDE). okteta is much better. Feb 27, 2013 at 19:14
  • 48
    I'm glad that when such questions get closed, they don't get deleted and can be voted on. That way, I can see the Q&A format I want, rather than reading a bunch of useless forums elsewhere on the net. Mar 17, 2015 at 6:06
  • 1
    I use sweetscape.com/010editor on Linux. Not free but worth the money ( no affiliation )
    – kervin
    Jul 5, 2015 at 23:28
  • 23
    wtf on closing this. "software tools commonly used by programmers" would make this on topic (and "unique to software development" is just a stupid requirement ... nothing is unique to software development. eg. I could use a C compiler for hardware benchmarking). hex editors are useful for programming, eg. binary protocols and file formats;, and making disk utilitites, especially for data recovery. In my case I was about to write a python program to find a missing NTFS partition (testdisk failed since it uses CHS ... wtf), and wanted to see the "magic" of a good partition in a hex editor first.
    – Peter
    Oct 30, 2015 at 15:02
  • 6
    The rule used to close this is stupid. Recommendations for open source tools to help with our work is anything BUT off-topic. Sep 8, 2018 at 13:44

4 Answers 4

298

Bless is a high quality, full featured hex editor.

It is written in mono/Gtk# and its primary platform is GNU/Linux. However it should be able to run without problems on every platform that mono and Gtk# run.

Bless currently provides the following features:

  • Efficient editing of large data files and block devices.
  • Multilevel undo - redo operations.
  • Customizable data views.
  • Fast data rendering on screen.
  • Multiple tabs.
  • Fast find and replace operations.
  • A data conversion table.
  • Advanced copy/paste capabilities.
  • Highlighting of selection pattern matches in the file.
  • Plugin based architecture.
  • Export of data to text and html (others with plugins).
  • Bitwise operations on data.
  • A comprehensive user manual.

wxHexEditor is another Free Hex Editor, built because there is no good hex editor for Linux system, specially for big files.

  • It uses 64 bit file descriptors (supports files or devices up to 2^64 bytes , means some exabytes but tested only 1 PetaByte file (yet). ).
  • It does NOT copy whole file to your RAM. That make it FAST and can open files (which sizes are Multi Giga < Tera < Peta < Exabytes)
  • Could open your devices on Linux, Windows or MacOSX.
  • Memory Usage : Currently ~10 MegaBytes while opened multiple > ~8GB files.
  • Could operate thru XOR encryption.
  • Written with C++/wxWidgets GUI libs and can be used with other OSes such as Mac OS, Windows as native application.
  • You can copy/edit your Disks, HDD Sectors with it.( Usefull for rescue files/partitions by hand. )
  • You can delete/insert bytes to file, more than once, without creating temp file.

DHEX is a more than just another hex editor: It includes a diff mode, which can be used to easily and conveniently compare two binary files. Since it is based on ncurses and is themeable, it can run on any number of systems and scenarios. With its utilization of search logs, it is possible to track changes in different iterations of files easily. Wikipedia article

You can sort on Linux to find some more here: http://en.wikipedia.org/wiki/Comparison_of_hex_editors

14
  • 4
    How to delete or add bytes with DHEX?
    – Steven Lu
    Jul 27, 2013 at 22:37
  • 2
    I have, for small binary file editing, resorted to using xxd -r. If you are on OS X, HexFiend is fantastic. (I was editing a file containing a password so I didn't want to copy it over a network)
    – Steven Lu
    Jul 27, 2013 at 22:48
  • 2
    wxHexEditor at 0.22 still has serious usability problems/limitations, but seems still the best one. Nov 19, 2014 at 18:49
  • 1
    Be careful if you decide to use wxHexEditor. The file hex diff tool isn't working properly (skips some differences). I lost quite some time because of this.
    – Ivan Š
    Feb 9, 2015 at 12:18
  • 4
    bless is now unusable for me. There is a crippling bug that doesn't allow files to be overwritten within the application. Look elsewhere.
    – ross
    Jul 26, 2017 at 17:14
153

I am a VIMer. I can do some rare Hex edits with:

  • :%!xxd to switch into hex mode

  • :%!xxd -r to exit from hex mode

But I strongly recommend ht

apt-cache show ht

Package: ht
Version: 2.0.18-1
Installed-Size: 1780
Maintainer: Alexander Reichle-Schmehl <[email protected]>

Homepage: http://hte.sourceforge.net/

Note: The package is called ht, whereas the executable is named hte after the package was installed.

  1. Supported file formats
    • common object file format (COFF/XCOFF32)
    • executable and linkable format (ELF)
    • linear executables (LE)
    • standard DO$ executables (MZ)
    • new executables (NE)
    • portable executables (PE32/PE64)
    • java class files (CLASS)
    • Mach exe/link format (MachO)
    • X-Box executable (XBE)
    • Flat (FLT)
    • PowerPC executable format (PEF)
  2. Code & Data Analyser
    • finds branch sources and destinations recursively
    • finds procedure entries
    • creates labels based on this information
    • creates xref information
    • allows to interactively analyse unexplored code
    • allows to create/rename/delete labels
    • allows to create/edit comments
    • supports x86, ia64, alpha, ppc and java code
  3. Target systems
    • DJGPP
    • GNU/Linux
    • FreeBSD
    • OpenBSD
    • Win32
5
  • 4
    I love the vi command! I tried installing ht and got mired in a bunch of TeX broken dependencies. Ended up using shed
    – Krista K
    Aug 18, 2013 at 1:41
  • 10
    To install ht: sudo apt-get install ht. To run: hte <file> note the trailing e! hte, not ht. I have no clue why the package couldn't also be called hte.
    – overthink
    Sep 9, 2013 at 14:07
  • @overthink maybe because of ht of package tex4ht May 22, 2015 at 15:39
  • 2
    Don't forget to :set binary when using vim + xxd! Otherwise, vim will add a line terminator to the end of the file, which has a very high chance of corrupting said file (and it does. A lot). Binary mode ensures that vim leaves that out. On a somewhat-related note, you can change the file format between unix/max/windows by using :set ff=[unix/mac/dos], to ensure vim uses the correct line endings for the target system. Feb 3, 2018 at 5:24
  • If you plan on adding/removing bytes, consider using xxd -p and xxd -r -p. The -p option disables the address prefix and the ASCII preview, leaving only the raw hexadecimal bytes. Apr 22, 2020 at 14:42
16

Personally, I use Emacs with hexl-mod.

Emacs is able to work with really huge files. You can use search/replace value easily. Finally, you can use 'ediff' to do some diffs.

1
  • is there a non-emacs one? I know how to do xxd/vim combos, but that can be annoying sometimes.
    – Marcin
    Apr 1, 2011 at 13:37
10

wxHexEditor is the only GUI disk editor for linux. to google "wxhexeditor site:archive.getdeb.net" and download the .deb file to install

5
  • I tried installing on Ubuntu 14 and it's really hard and it still fails. Aug 31, 2015 at 5:28
  • @Yan King Yin, give a try to Bless Hex Editor, it's good for editing binary file
    – diyism
    Sep 1, 2015 at 6:20
  • 2
    Thanks, but I'm using Okteta now, it satisfied my needs for now... Sep 4, 2015 at 11:58
  • To install in Ubuntu, google for wxhexeditor ppa which should give you launchpad.net/ubuntu/+source/wxhexeditor Aug 12, 2016 at 14:55
  • 1
    To install to ubuntu try sudo apt-get install wxhexeditor
    – empty
    Oct 23, 2018 at 20:00