Supported Formats
Vaste opens any file. It decides how to show a file from its extension and its first bytes, and opens it in the view that fits. You can switch views at any time: every file can be shown in Text view and Hex view.
How Vaste chooses a view
Section titled “How Vaste chooses a view”When you open a file, Vaste goes through these checks in order and stops at the first that applies:
- Compressed files: if the file starts with the signature of gzip, zstd, xz, bzip2, or zip, Vaste decompresses it and applies the checks below to the decompressed content. See Compressed formats.
- The extension: some extensions decide the type on their own:
- Text:
.txt,.log,.out,.err,.md,.cfg,.ini,.conf,.toml,.yaml,.yml,.xml,.html,.htm,.css,.js,.ts,.rs,.py,.rb,.go,.java,.c,.h,.cpp,.hpp,.sh,.bash,.zsh,.fish,.ps1,.bat,.cmd,.sql,.json,.svelte,.vue,.jsx, and.tsx. - CSV:
.csv, if Vaste can detect its delimiter. Otherwise the file is text. - TSV:
.tsvand.tab, always tab-separated. - NDJSON:
.ndjsonand.jsonl.
- Text:
- Binary: a file with any other extension, or none, is binary if its first 8 KiB contain a NUL byte (
0x00). A byte order mark at the start is ignored for this check. - NDJSON by content: otherwise, a file is NDJSON if the non-empty lines at its start are JSON records. Vaste checks up to 5 lines, which must end within the first 8 KiB, and each must start with
{or[and be valid JSON. At least 2 lines are needed. - Text: every other file is text.
The extension check ignores case: DATA.CSV counts as .csv.
| Type | Status bar | Opens in |
|---|---|---|
| Text | TXT |
Text view |
| CSV | CSV |
Table view |
| TSV | TSV |
Table view |
| NDJSON | NDJSON |
NDJSON view |
| Binary | BIN |
Hex view |
When you restore a session, a file opens in the view it was in when you closed it, if that view is still available.
Find in files uses a simpler check: it skips every file with a NUL byte in its first 8 KiB, whatever its extension, so it also skips UTF-16 files that open in Text view.
Choices that change the type
Section titled “Choices that change the type”- A CSV dialect you apply to a text file makes it CSV from then on. See Read a text file as a table.
- NDJSON files with long records, without the
.ndjsonor.jsonlextension, can open as text: to recognize NDJSON, Vaste needs the first 5 records to end within the first 8 KiB, or every record of a shorter file. Rename the file with one of these extensions. - A
.jsonfile always opens as text, even when every line is a JSON record. Rename it to.ndjsonor.jsonlto open it in NDJSON view.
CSV and TSV detection
Section titled “CSV and TSV detection”For a .csv file, Vaste reads the first 20 non-empty lines, up to 8 KiB, and tries comma, tab, semicolon, and pipe as the delimiter. It picks the delimiter that gives every line the most similar number of fields, and that appears at least once per line on average. It needs at least 2 lines.
- Quote: double quotes, unless the fields are wrapped in single quotes and never in double quotes.
- Header row: detected from the content. For example, a row of names above rows of numbers counts as a header.
When Vaste is not sure about the result, the dialect item in the status bar turns yellow. For .tsv and .tab files, only the header row is detected. See CSV dialect.
Encodings
Section titled “Encodings”Vaste detects a file’s encoding when it opens the file:
- A byte order mark selects UTF-8, UTF-16LE, or UTF-16BE.
- Otherwise, if the first 64 KiB of the file are valid UTF-8, or contain a NUL byte, the encoding is UTF-8.
- Otherwise, Vaste guesses the encoding from the content, and the status bar adds (detected).
You can reopen any file with another encoding. For the list of encodings, how UTF-16 files open, and how to change the encoding, see Encodings and line endings.
Compressed formats
Section titled “Compressed formats”| Format | Signature checked | Notes |
|---|---|---|
| gzip | Yes | Including files made of several gzip parts joined together |
| zstd | Yes | |
| xz | Yes | |
| bzip2 | Yes | Including files made of several bzip2 streams |
| zip | Yes | Files stored or compressed with Deflate or Deflate64. Encrypted archives and other methods cannot be opened. |
Vaste recognizes these formats by their first bytes, not their extension. It removes one layer of compression, so a .tar.gz file opens as the .tar archive inside it, in Hex view.
Before it decompresses a file, Vaste estimates the decompressed size to decide whether to ask for confirmation:
- gzip: the size recorded at the end of the file. For a file made of several gzip parts, only the last part’s size is recorded, so the estimate can be much too small. Very large archives count as unknown.
- zstd: the size recorded at the start of the file, if the file includes it.
- xz and bzip2: unknown, so Vaste always asks.
- zip: the exact size of the chosen file.
See Compressed files.
Line endings
Section titled “Line endings”The status bar shows the file’s line endings: LF, CRLF, or Mixed when the file has both. Hover over the item to see how many of each the file has. Vaste reads all of them as line breaks.
Next steps
Section titled “Next steps”- Opening files: the ways to open a file
- Limits: the sizes and counts Vaste works within