The supported signatures are EF BB BF for UTF-8, FE FF and FF FE for UTF-16 BE/LE, and 00 00 FE FF and FF FE 00 00 for UTF-32 BE/LE.
Four-byte UTF-32 signatures are tested before two-byte UTF-16 signatures because UTF-32 LE begins with FF FE. This prevents a prefix collision from removing only half of the marker.
File mode operates on Uint8Array data. It copies the byte range after the signature into the result without TextDecoder, TextEncoder, Unicode normalization, newline conversion, or trimming.
Decoded-text mode is a different contract: it checks whether the first UTF-16 code unit is U+FEFF, rejects unmatched surrogates, removes at most that one character, and encodes downloads as UTF-8.
An incomplete prefix is evidence, not permission to mutate. When a short stream matches only the beginning of a supported signature, the result remains byte-for-byte unchanged and displays a warning.
The browser limits file input to 26,214,400 bytes and decoded text to 1,048,576 UTF-8 bytes. Processing stays on the device in the normal workflow, while aggregate analytics excludes names and content.