Hex View
Hex view shows a file as rows of bytes: the offset of each row, the bytes as hexadecimal numbers, and the same bytes as ASCII characters. It works for every file, whatever its size, and it shows the bytes exactly as they are on disk. For the tools that summarize a whole file, such as checksums and the entropy strip, see Hex analysis tools.
Open a file in Hex view
Section titled “Open a file in Hex view”Vaste opens a file in Hex view when it finds a NUL byte near the start of the file, unless its extension is one that Vaste reads as text, CSV, TSV, or NDJSON, such as .txt, .log, or .csv. The status bar then shows the file type BIN. For the full rules, see Supported formats.
To show any file in Hex view, press Ctrl + H or select Hex in the view switcher. Press Ctrl + H again, or select Hex again, to return to Text view. Leaving Hex view always returns to Text view, even if you came from Table view or NDJSON view.
Hex view and Text view each keep their own position. Switching does not take you to the same place in the file: the first time you open Hex view for a file, it starts at the top.
Read the rows
Section titled “Read the rows”Each row has three parts:
- The offset of the row’s first byte, as 8 uppercase hexadecimal digits, for example
0001F400. Offsets beyond 4 GiB have more digits. The offset column stays in place when you scroll sideways. - The hex pane, with each byte as two hexadecimal digits. A wider gap marks the middle of the row.
- The ASCII pane, with each byte as a character. Bytes from
0x20to0x7Eshow as the matching character, and every other byte shows as..
On the last row, the positions after the end of the file are blank.
Byte classes
Section titled “Byte classes”With the Colour bytes by class setting on, the default, both panes tint each byte by its class. The colors come from the current theme:
| Class | Bytes | Tint |
|---|---|---|
| Null | 0x00 |
Dimmed |
| Whitespace | Tab, line feed, 0x0B, 0x0C, carriage return, and space |
The theme’s success color, usually green |
| Printable | 0x21 to 0x7E |
The theme’s info color, usually blue |
| Control | Other bytes from 0x01 to 0x1F, and 0x7F |
The theme’s danger color, usually red |
| High | 0x80 to 0xFF |
The theme’s warning color, usually yellow |
The classes make the structure of a file visible at a glance: runs of printable bytes are text, long runs of NUL bytes are padding, and a mix of high and control bytes is binary data. Hex view has no on-screen legend.
Move the byte cursor
Section titled “Move the byte cursor”Click a byte in either pane to place the byte cursor on it. The cursor’s row is highlighted, and the data inspector reads the bytes at the cursor.
| Key | Action |
|---|---|
Left, Right |
Move the cursor one byte |
Up, Down |
Move the cursor one row, or scroll a row when there is no cursor |
Page Up, Page Down, Space, Shift + Space |
Scroll one screen. The cursor stays where it is. |
Home, End |
Scroll to the start or end of the file. The cursor stays where it is. |
Up on the first row moves the cursor to the first byte of the file, and Down on the last row moves it to the last byte.
Hex view has no command to go to an offset, and Go to line works in Text view only. To reach a place in a large file, click the entropy strip, select a search result, or jump to a byte bookmark.
Select and copy bytes
Section titled “Select and copy bytes”To select a range of bytes, press on the first byte and drag to the last one, in either pane and across rows. Dragging past the top or bottom edge scrolls the view and keeps extending the selection. You can also place the cursor on the first byte, then hold Shift and click the last byte, or extend with Shift and an arrow key. Press Esc to clear the selection and keep the cursor.
Press Ctrl + C to copy the selected bytes as uppercase hexadecimal separated by spaces, for example FF D8 FF E0. Vaste shows Copied N bytes. Copying needs a selection of at least 2 bytes: with only the cursor on one byte, Ctrl + C copies nothing. Hex view cannot copy the bytes as ASCII text.
- A selection of more than 64 KiB cannot be copied. Vaste shows Selections over 65536 bytes cannot be copied yet.
- If part of the selection is far from the rows on screen, Vaste shows Scroll the selection into view before copying.
Data inspector
Section titled “Data inspector”The data inspector shows the bytes at the cursor read as numbers and characters. Use it to read a value in a file header, such as a size, a count, or a version number. Open it in one of these ways:
- Select Inspector in the Hex view toolbar.
- Select More actions (
…) → Data inspector. - Press
Alt + I.
The panel opens on the right of Hex view. Until you place the cursor, it shows Click a byte to inspect it. Then it shows the Offset of the cursor in hexadecimal, decimal, and octal, for example 0x1F40 · 8,000 · 0o17500. With a selection, it also shows the Selection range and size.
The table reads the bytes starting at the cursor as each of these types, in both byte orders, Little endian and Big endian:
| Type | Bytes read |
|---|---|
int8, uint8 |
1 |
int16, uint16 |
2 |
int32, uint32 |
4 |
int64, uint64 |
8 |
float32 |
4 |
float64 |
8 |
UTF-8 |
1 to 4 |
UTF-16LE |
2 |
The 1-byte types and the character rows fill the Little endian column only. The character rows show the character and its code point, for example é U+00E9. A control character shows as ·, and half of a UTF-16 surrogate pair shows only its code, such as U+D83D. Near the end of the file, a type that needs more bytes than remain shows —, and so does a character that is not valid in its encoding.
The inspector always reads at the cursor. With a selection made by holding Shift and clicking, or Shift with an arrow key, the cursor is the end you moved last, not the start of the selection.
To make the panel wider or narrower, drag its left edge. Double-click the edge to return to the default width. Vaste remembers the width on this computer.
To close the panel, select its close button, press Alt + I again, or press Esc while the panel has focus.
Search and bookmarks in Hex view
Section titled “Search and bookmarks in Hex view”Two search modes are made for Hex view. See Search modes:
- Hex byte patterns (0x) find a sequence of bytes, such as
FF D8 FF. - Printable strings (Str) list the runs of readable text. See Find strings.
Matches are highlighted in both panes. Selecting a match in the results list, or pressing F3 or Shift + F3, scrolls to it and places the cursor on its first byte. Run these searches in Hex view: when you run them in Text view, selecting a result does not move anywhere. Matches of a text search are not shown in Hex view.
To bookmark a byte, press m, then a letter. The bookmark marks the byte under the cursor, or the first byte on screen when there is no cursor. See Bookmarks.
With the Overview markers setting on, markers beside the scrollbar show the search matches, the current match, and the byte bookmarks.
The status bar in Hex view
Section titled “The status bar in Hex view”The status bar shows Hex View and the offset of the cursor in hexadecimal, decimal, and octal. With a selection of 2 bytes or more, it adds the size of the selection, for example sel 4.0 KB. Without a cursor, it shows Row N, the number of the top row on screen.
Settings for Hex view
Section titled “Settings for Hex view”These settings are in the Hex view section of Settings:
| Setting | What it does | Default |
|---|---|---|
| Bytes per row | How many bytes each row shows: 8, 16, or 32 | 16 |
| Byte grouping | How many bytes are joined without a space in the hex pane: 1, 2, 4, or 8. The wider gap in the middle of the row stays. | 1 |
| Colour bytes by class | Tint the bytes by class in both panes | On |
When you change Bytes per row, the same byte stays at the top of the view, and the cursor stays on its byte. The Overview markers and Viewer font size settings also apply to Hex view.
What Vaste keeps and clears
Section titled “What Vaste keeps and clears”Switching to another view and back keeps the cursor, the selection, and the position in Hex view. Reloading the file, reopening it with another encoding, or opening another file in the window clears the cursor and the selection.
Next steps
Section titled “Next steps”- Hex analysis tools: find strings, read the entropy strip and the byte histogram, and compute checksums
- Inspecting binary files: identify a file and read values from its header