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?

Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
  • 21
    For Ubuntu: `jeex` (GTK), `okteta` (KDE). `okteta` is much better. – Janus Troelsen Feb 27 '13 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. – Tyler Collier Mar 17 '15 at 06:06
  • 1
    I use http://www.sweetscape.com/010editor/ on Linux. Not free but worth the money ( no affiliation ) – kervin Jul 05 '15 at 23:28
  • @Masi He was asking for an editor, not a viewer. – mat Sep 17 '15 at 06:24
  • 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 '15 at 15:02
  • radare2 - is a framework for reverse engineering, also may work as hex editor: https://radare.gitbooks.io/radare2book/content/visual_mode/intro.html – AndreyT Mar 29 '16 at 13:45
  • 1
    @Peter According to the [Help Center](http://stackoverflow.com/help/on-topic), "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic" – Natecat May 22 '16 at 20:03
  • You could use Emacs for HEX editing. It's fast and can work really well with big files. Just type `M-x hexl-mode` – Kasmetski Oct 29 '16 at 22:09
  • See: https://www.slant.co/improve/topics/7433/~hex-editors-for-linux (web site for this purpose) – ideasman42 Jan 29 '17 at 08:57
  • 6
    The rule used to close this is stupid. Recommendations for open source tools to help with our work is anything BUT off-topic. – Juan Jimenez Sep 08 '18 at 13:44
  • It may be "on-topic" but answers would be opinion-based (and subject to becoming out-dated quickly). That's what is trying to be avoided. But I'm here for the opinions anyway. ;-) – mike65535 Oct 05 '18 at 15:29
  • Agreed, opinion based. Would need to see a feature comparison. Hex editors are programming tools, by extension the question is a programming question. Especially if the hex editor calculated hashes or at least CRC. Programming does not just mean code review and homework. – mckenzm Sep 02 '19 at 06:34
  • Try to have a look at [Fhex](https://github.com/echo-devim/fhex) a new hex editor written in C++11/Qt5 – RobotMan Oct 13 '19 at 20:59

4 Answers4

299

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

Aposhian
  • 801
  • 1
  • 10
  • 27
Gfy
  • 8,173
  • 3
  • 26
  • 46
  • 4
    How to delete or add bytes with DHEX? – Steven Lu Jul 27 '13 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 '13 at 22:48
  • @StevenLu is right. I wish there was something that lightweight for the linux environment. – Cripto Aug 01 '13 at 18:45
  • the wiki comparison tables are so messy.. but we can easy it by using something like chromium "inspect element" and delete all table rows (tr) that does not interest! we can even click on sort columns after removing rows!! :D – Aquarius Power Nov 19 '14 at 18:12
  • 2
    wxHexEditor at 0.22 still has serious usability problems/limitations, but seems still the best one. – Aquarius Power Nov 19 '14 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 09 '15 at 12:18
  • Is bless still maintained? It's quite nice, but has some easy bugs that haven't been fixed for ages (e.g. status line). And Ubuntu's packaging or something installs it without a configured tmp directory, so it can only save if it's overwriting in place (file length hasn't changed) – Peter Cordes Feb 16 '15 at 06:41
  • @StevenLu I looked at dhex source code, it seems that it's not possible to delete/add bytes (at least in current version 0.68) – mykhal Aug 19 '15 at 12:19
  • Bless says it can open block devices but it no way I'm seeing it reading sectors from /dev/sdc. How am I supposed to see a disk's sectors with this "blessed" piece of software? – bit2shift Jul 22 '16 at 01:59
  • Bless requires you install ton of dependent packages of mono. Avoid it – PT Huynh Jul 28 '16 at 01:00
  • 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 '17 at 17:14
  • `wxHexEditor` seems to be the best one out there for the time being [2018-04-16]. Color tags are a killer feature indeed. – hidefromkgb Apr 16 '18 at 08:31
  • Another -1 for bless; on Ubuntu 16.04 there are numerous issues with the configuration files, and a "sharing violation" on the preferences file. I would not recommend it. – cosimo193 Nov 17 '22 at 11:22
  • wxHexEditor, even at v 0.32, is buggy and unintuitive. Find and replace is pretty poor, and being unable to save to files it's made bigger isn't great. – cosimo193 Mar 09 '23 at 12:21
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 <tolimar@debian.org>

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
Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
kiiwii
  • 7,593
  • 2
  • 17
  • 9
  • 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 '13 at 01:41
  • 10
    To install ht: `sudo apt-get install ht`. To run: `hte ` **note the trailing e!** `hte`, not `ht`. I have no clue why the package couldn't also be called hte. – overthink Sep 09 '13 at 14:07
  • @overthink maybe because of `ht` of package `tex4ht` – Ciro Santilli OurBigBook.com May 22 '15 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. – Braden Best Feb 03 '18 at 05: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. – Denilson Sá Maia Apr 22 '20 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.

Sandro Munda
  • 39,921
  • 24
  • 98
  • 123
  • is there a non-emacs one? I know how to do xxd/vim combos, but that can be annoying sometimes. – Marcin Apr 01 '11 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

diyism
  • 12,477
  • 5
  • 46
  • 46