Two ways in
You press Ctrl+P, or Erya works out that the file was never text.
① Ctrl+P on a text file
Read-only. What you see is exactly what a save would write: the BOM, the current encoding, and LF or CRLF endings.
Ctrl+P again, or Esc, returns to text editing with the cursor on the same byte.
② A binary file opens here
Files that cannot be decoded as text, or that contain NUL bytes, start in this view — and cannot leave it, because there is no text to edit.
Below 64 MiB the bytes are editable; above it the file stays streamed and read-only (see 3.3.8).
A text document lives in a text buffer; the bytes are only a rendering of what it would become on disk. To edit bytes directly, the file has to be a binary file in the first place. To change a byte in a text file, edit the character, or change the encoding with F7 (see 3.1.2).
What is on the screen
Three columns: offset, bytes, printable characters.
| Column | What it shows |
|---|---|
| Offset | The position of the first byte on this row. At least eight digits, zero-padded, so short files still look like a classic dump. |
| Bytes | Two hexadecimal digits each, in groups of eight with an extra space between groups for counting. Missing bytes at the end of the file are blank. |
| Characters | Framed by |. Printable ASCII appears as itself; everything else is a . — so CJK text shows as runs of dots, one per byte. |
The status bar takes a form of its own: offset current/total │ bytes per row │ view kind │ encoding or mode │ filename. The byte under the cursor is highlighted in both columns at once.
Four keys in the read-only view
Movement works as usual; four keys belong to this screen.
| Key | What it does |
|---|---|
| W | Switches between 16 and 32 bytes per row. 32 needs a 144-column terminal; in a narrower window it stays at 16 and says “The terminal is too narrow; 32 bytes per row need 144 columns”. |
| O | Shows offsets in decimal or hexadecimal. “Offsets now shown in decimal”. |
| G or Ctrl+G | Jumps to an offset (see 3.3.4). |
| Ctrl+P or Esc | Back to text editing. |
| Arrows / PageUp PageDown | Move by byte, row, and page. |
| Home End | First or last byte of the row. |
| Ctrl+Home Ctrl+End | Start or end of the file. |
The hexadecimal view never loads the whole file into memory; it reads the section you are looking at. Opening a several-hundred-megabyte file this way is instant.
Jumping to an offset
Four notations, because decimal and hexadecimal are so easy to confuse.
| You type | How it is read |
|---|---|
| 1F40 | In whatever base the offset column is using. The prompt says which that is. |
| 0x1F | Always hexadecimal |
| $1F | Always hexadecimal |
| 1Fh | Always hexadecimal |
| 0d31 | Always decimal |
- On success: “Jumped to offset 0x1F”.
- Malformed input gives “Invalid offset; enter a number, or prefix it with 0x for hexadecimal” and asks again.
- An offset past the end stops at the end.
Offsets copied from other tools (xxd, a debugger, a format specification) are usually hexadecimal, so adding 0x is the safe habit — no need to check which base the column is in.
Binary files open here automatically
The test is simple: is there a NUL byte in the first 8 KiB?
- The hint bar switches to the byte-editing set, and names the way out at the end of it.
- The second status cell reads Binary (not “Hex”), and the third is Overwrite, Insert, or Read-only.
- Esc does not return to text editing, because there is none. It simply repeats the exits: “A binary file can only be read in the hexadecimal view; F11 closes the tab, Ctrl+X quits”.
UTF-16 text is full of NUL bytes and looks very much like a binary file. Erya recognises the pattern and reports an unsupported text encoding instead — rather than presenting it as editable bytes, which would invite you to damage a perfectly good text file (see 3.1.1).
Changing one byte
Type two hexadecimal digits: the high nibble, then the low one.
- Put the cursor on the byte. It is highlighted in both columns.
- Type the first digit. For 4A, press 4 — the high nibble is set.
- Type the second. Press A; the byte becomes 4A and the cursor advances.
- The two presses are one undo step. A single Ctrl+Z restores the original value, never half of it.
You get “Type a hexadecimal digit (0-9, A-F) to change a byte”. Only 0–9 and A–F write anything (either case).
Save, undo, redo, and Save As all use their usual keys (Ctrl+S, Ctrl+Z, Ctrl+Y, F12). A binary document has no text buffer, so encoding conversion, line-ending conversion, and comparison do not apply; pressing those keys gives “The hexadecimal view does not support this action”.
Inserting and deleting bytes
This screen has its own I key, because Mac keyboards have no Insert.
| Key | What it does |
|---|---|
| I (or Insert) | Switches between overwrite and insert. The third status cell follows. |
| Backspace | Deletes the byte before the cursor |
| Delete | Deletes the byte under the cursor |
Overwrite (the default)
Typed bytes replace what was there; the file length does not change.
Use this for structured formats — PNG, ZIP, firmware — where the length has to stay put.
Insert
Typed bytes are inserted, pushing the rest along; the file grows.
In insert mode the cursor may sit past the last byte, which is how you append.
Erya has 100 undo steps, but the file format usually has no tolerance at all: one byte of length difference, a checksum left stale, and the file is broken. Press F12 for a copy first, or duplicate the original outside Erya.
Big files stay streamed and read-only
The same 64 MiB line as for large text files.
| File | Opens as | Editable? |
|---|---|---|
| Binary below 64 MiB | Bytes held in memory | Yes: change, insert, delete, undo, save |
| Binary at 64 MiB or more | Streamed from disk | No, read-only. The third status cell says Read-only |
- Opening a large binary reports “Opened binary file disk.img (4.2 GB) in the read-only hexadecimal view”.
- Attempting to change something gives “This binary file is read-only and cannot be changed”.
- The hint bar switches to its read-only variant, ending in the word “read-only”.
Editable means the whole byte sequence has to be in memory. Erya would rather keep a large file read-only than exhaust your machine when you open an 8 GB image — the same trade-off as for large text files (see 3.2.3).
Common problems
Seven situations in the hexadecimal view.
| Symptom | Cause and fix |
|---|---|
| You cannot edit a text file's bytes | The view is read-only for text files (3.3.1). |
| Esc does not take you back | It is a binary file; there is no text editing to return to. F11 or Ctrl+X (3.3.5). |
| W will not give 32 bytes | The terminal is under 144 columns. Enlarge it and press again (3.3.3). |
| A jump lands somewhere unexpected | The input was read in the other base. Use the 0x prefix (3.3.4). |
| A letter key says “type a hexadecimal digit” | Only 0–9 and A–F change bytes (3.3.6). |
| CJK text is a row of dots | The character column shows printable ASCII only; multi-byte characters become dots (3.3.2). |
| The file no longer opens after editing | Binary formats care about length and checksums. Restore your backup (3.3.7). |