A BOM Remover alternative for decoded text removes exactly one U+FEFF at string position zero while preserving every internal, trailing, or second-leading occurrence.

The BOM Remover is built for that narrow task. It checks the first UTF-16 code unit of pasted, already decoded text. If that unit is U+FEFF, the tool removes exactly one code unit; otherwise, the output remains identical to the input.

This position-based behavior matters. A byte order mark, invisible zero-width character, whitespace problem, and encoding error are different concerns. BOM Remover does not decode files, identify encodings, normalize text, or remove arbitrary invisible characters.

bom remover alternative
BOM Remover Alternative: Remove One Leading U+FEFF

Match the tool to the layer you are working at

Start by deciding whether your problem exists in raw bytes or in decoded text. A decoder or editor with a suitable BOM policy is appropriate when the original file signature must be handled before an application receives the text. BOM Remover is appropriate when a trusted decoder or editor has already exposed one unwanted leading U+FEFF.

Task Appropriate approach Important boundary
Remove an encoding signature from raw file bytes Use a decoder or editor configured with the appropriate BOM policy The operation must happen before the application receives decoded text
Remove one unwanted leading U+FEFF from decoded text Use BOM Remover Only string position zero is checked
Remove several BOM-like characters from different positions Use a separate, position-specific workflow BOM Remover will not scan or globally replace them
Inspect other invisible or whitespace characters Use a dedicated invisible-character inspection workflow Other invisible characters are outside BOM Remover’s scope

U+FEFF is the Unicode character associated with a byte order mark. At the beginning of a decoded text stream, it can represent an encoding signature. A decoder may consume that signature before the text reaches a textarea, while another source may expose the decoded U+FEFF as the first character. BOM Remover can act only on the latter case.

What the exact-one removal preserves

The transformation is deliberately narrow: test the first UTF-16 code unit, remove it if it equals U+FEFF, and otherwise return the exact input. It does not call trimming, normalization, global replacement, or a global regular expression.

U+FEFF position Result Reason
Only character at the start The output is empty Removing the one leading code unit is a successful transformation
First of two consecutive leading characters The first is removed and the second remains Only one code unit is removed per operation
Middle of the text Preserved The tool checks only position zero
After a line break Preserved A line break makes it a later code unit
At the end Preserved The transformation does not scan backward
No leading U+FEFF Exact input returned There is no leading code unit to remove

Two leading U+FEFF characters are handled intentionally. The first may represent the signature, while the second can be initial content. One run removes the first and leaves the second at the beginning of the output. Running the remover again would remove that newly leading character, so check the status before repeating the operation.

Later U+FEFF characters can also have content semantics. Removing every occurrence would therefore be destructive. BOM Remover is not a general invisible-character cleaner, Unicode normalizer, whitespace trimmer, mojibake repairer, or encoding converter.

Remove one leading BOM from pasted text

  1. Start with decoded text. Paste already decoded text into the input, including the invisible leading U+FEFF when it is present. Do not paste raw file bytes expecting the tool to recognize a byte signature. Keep the input at or below 200,000 UTF-16 code units: exactly 200,000 is accepted, while the next code unit is rejected before processing.
  2. Run the remover and read the status. The summary confirms whether exactly one leading U+FEFF was removed or whether no leading U+FEFF was found. It also reports the complete input and output lengths in UTF-16 code units.
  3. Review the entire output. Check the beginning, internal content, line endings, and every intentional later U+FEFF. CRLF and LF endings, tabs, NUL, emoji, combining marks, surrogate pairs, non-Latin scripts, whitespace, and later U+FEFF occurrences are not normalized or filtered. The output is independently checked against the 200,000-code-unit limit, with the exact boundary accepted and boundary plus one rejected.
  4. Copy only after verification. Use the tool’s copy control to copy the complete reviewed output. The copied text is the remaining output without normalization. If clipboard access is denied, the full read-only result remains available for manual selection. Keep the original source until the replacement has been checked.

Empty input is a valid no-change case. Input containing only one leading U+FEFF also produces a valid empty output. The result panel and summary still appear, so an absence of visible characters does not mean the operation failed.

Verify the result instead of trusting visual appearance

A browser can visually normalize the way invisible characters appear inside a textarea. The reliable checks are the removal status and the reported UTF-16 code-unit lengths, followed by inspection of the complete output. Because the transformation removes at most one code unit, an accepted input cannot expand during processing.

Editing or clearing the input immediately clears the previous output, error, summary, removal status, copy message, and pending copy timer. An over-limit error cannot leave an older successful result visible, which prevents accidentally copying text that belongs to an earlier input.

Clipboard access is asynchronous, so the tool also guards against stale completion messages. Editing, clearing, retrying, or leaving the page invalidates the pending copy operation; a late clipboard permission response cannot restore an outdated “Copied” state. For larger text changes, you can save the original and cleaned versions and compare the two texts with Diff Checker, while treating BOM Remover’s status as the confirmation of the exact U+FEFF operation.

Choose a decoder or editor when bytes are involved

The UTF-8 byte signature is EF BB BF, while UTF-16 and UTF-32 use different byte signatures. Once a browser textarea contains decoded characters, those original bytes are unavailable to the tool. BOM Remover cannot identify the original encoding, byte order, decoder behavior, or whether a source file once contained a particular byte sequence.

For raw-byte workflows, use the WHATWG Encoding Standard as a reference for decoding and BOM-handling rules, then select a decoder or editor with a policy appropriate for the application. A decoder that consumes the signature may solve the problem before the text is pasted. A decoder or editor that intentionally preserves it may require one exact leading removal afterward.

JavaScript deserves particular attention because the JavaScript lexical grammar on MDN treats U+FEFF as whitespace. An invisible leading character can therefore affect source parsing even though it is not visible on screen. The same position-specific cleanup can help when a leading U+FEFF interferes with a parser, comparison, shebang, column name, or another first-character check after trusted decoding.

Pick the least destructive workflow

  • Raw file or stream: choose a decoder or editor with an explicit BOM policy.
  • Decoded text with one unwanted leading U+FEFF: use BOM Remover and verify its status.
  • Several BOM-like characters in different positions: inspect each location rather than applying a global replacement.
  • Arbitrary invisible characters, mojibake, or invalid encoding: use a workflow designed for that specific problem.

The safest replacement rule is to modify only the decoded character that is known to be unwanted. BOM Remover follows that rule: it removes exactly one leading U+FEFF, leaves every later occurrence untouched, and does not claim to repair the encoding that produced the text. For the broadest compatibility, verify the cleaned output in the same parser or application that exposed the problem before overwriting the source.