Guides

Trim outer whitespace without changing internal spaces

Follow these steps using a local file and keep the original.

Trim outer whitespace without changing internal spaces
Actual local tool workspace with a synthetic sample.

Prepare the example

Create disposable test input with the exact content below (UTF-8 text unless marked hex). For duplicate filenames, save the two files in separate folders.

spacing.txt
  alpha  beta  

Create a text line with two leading spaces, alpha, two spaces, beta and two trailing spaces.

Run the workflow

  1. Open the related tool below and load the prepared file(s).
  2. Trim the file and check that alpha and beta still have two internal spaces.

Verified example result

This example was reproduced in Chrome on 2026-12-04 using FileTypeKit 0.9.0 and synthetic data. The expected result or expected refusal was checked; this does not establish support for every real file.

The downloaded output was checked against the expected properties below.

Example output
spacing.txt
Observed size
11 bytes
SHA-256
5fb778aa5fc0dd29d7b12d4f55c540bb056c3997d5d584bf71f1d885b861686e

This digest describes the tested output; other encoders or versions may produce different bytes. Verify the expected properties, not only the digest.

Limitations and what to verify

Indentation-sensitive code may change meaning after trimming.

Open related tool