Hex Editor
ETWriter includes a hexadecimal editor for inspecting and modifying raw file bytes. Unlike the standard text editor, Hex Editor mode works directly with byte values.
What Is Hexadecimal Editing?
A byte contains eight bits and can be represented using two hexadecimal digits.
For example:
| Decimal | Hexadecimal | ASCII |
|---|---|---|
| 65 | 41 | A |
| 66 | 42 | B |
| 67 | 43 | C |
| 32 | 20 | Space |
| 10 | 0A | Line feed |
| 0 | 00 | NUL |
| 255 | FF | Not standard printable ASCII |
Hexadecimal editing is useful when ordinary text editing cannot accurately represent a file's underlying structure.
Opening the Hex Editor
- Select Hex Editor from the mode selector.
- Click Open.
- Choose a file.
- Review its hexadecimal content.
- Make the necessary byte changes.
- Enter an output filename.
- Click Save.
Understanding the Interface
Hex Editor mode displays two areas:
| Area | Purpose |
|---|---|
| Hex Editor | Displays editable hexadecimal byte values |
| Preview (ASCII) | Displays a text representation of the parsed bytes |
The interface also maintains a byte count.
Hexadecimal Representation
Consider the text:
HelloIts ASCII-compatible UTF-8 bytes are:
48 65 6C 6C 6FEach pair represents one byte.
| Hex Byte | Character |
|---|---|
48 | H |
65 | e |
6C | l |
6C | l |
6F | o |
Editing Bytes
To change the content:
- Locate the hexadecimal byte to modify.
- Replace the two hexadecimal digits.
- Review the ASCII preview.
- Save the resulting byte sequence.
Example
Original bytes:
43 61 74ASCII preview:
CatModified bytes:
42 61 74ASCII preview:
BatChanging 43 to 42 changes the first byte from uppercase C to uppercase B.
Separators and Whitespace
ETWriter accepts hexadecimal byte pairs separated by spaces or line breaks.
For example:
48 65 6C
6C 6FThe implementation extracts matching two-character hexadecimal sequences.
Characters that are not part of a recognized hexadecimal pair are not written as bytes.
Caution: The parser is permissive. It does not enforce a strict hexadecimal document format. Always inspect the parsed byte count and resulting output before saving.
Colorized Hex Display
When CodeMirror is available, ETWriter applies a custom hexadecimal display mode.
Each byte value receives an assigned color from a palette spanning all 256 possible byte values.
This makes changes and repeated byte values easier to distinguish visually.
Special Values
Two byte values receive additional visual emphasis:
| Byte | Special Styling |
|---|---|
00 | Dotted underline |
FF | Dotted underline |
The colors are visual aids. They do not indicate whether a byte is valid or invalid.
ASCII Preview
The ASCII preview updates as the hexadecimal content changes.
Printable ASCII bytes from decimal 32 through 126 are displayed as characters.
Other byte values appear as periods (.).
Example
Hex:
41 42 00 43 0APreview:
AB.C.The NUL byte and line-feed byte appear as periods because they are outside the printable ASCII range.
Byte Count
ETWriter calculates the number of bytes obtained from the current hexadecimal input.
For example:
DE AD BE EFcontains four bytes.
The byte count represents the parsed binary output, not the number of visible characters typed into the editor.
Saving Binary Output
ETWriter converts the hexadecimal pairs into a byte array.
The resulting bytes are saved directly to the selected output file.
This makes Hex Editor mode suitable for modifying arbitrary binary data.
Important Precautions
Editing binary files can corrupt their internal structures.
Small changes may affect:
- File headers
- Encoded values
- Checksums
- Offsets
- Compressed data
- File-format structures
ETWriter does not automatically recalculate file checksums, update embedded references, or validate binary formats.
Recommended Workflow
- Keep an untouched copy of the original file.
- Inspect the intended byte positions.
- Make limited changes.
- Save to a new output filename.
- Verify the output using an appropriate application or validator.
Warning: The Hex Editor is a byte-editing tool, not a format-aware binary repair utility.
Updated 9 days ago
