Remove BOM

Remove exactly one U+FEFF from the beginning of already decoded text while preserving identical code points elsewhere.

freeworks offlinenothing uploaded
ToolBOM Remover
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

JavaScript position zero is checked for U+FEFF and sliced once when present. Interior U+FEFF and every U+FFFE remain untouched because they are not byte-order signatures after decoding.

  • The Unicode UTF FAQ says a signature can occur only at the start of a data stream and is neither required nor recommended where UTF-8 identification is otherwise known.
  • No encoding is guessed because browser input is already a Unicode string, not the original bytes.

Worked example

Remove UTF-8 BOM
Strip the invisible BOM character from the start of text
Input
											Hello, World!
										
Output
												Hello, World!
											

When to use this

CSV imports recover exact first-column headers, JSON parsers see { at position zero, and source-code fixtures compare signed with unsigned decoded text.

Edge cases

  • A leading U+FEFF disappears once, making the following CSV header or JSON opening brace the first character.
  • U+FEFF between left and right is retained because an interior character is not a stream signature.
  • U+FFFE survives instead of being mistaken for a reversed UTF-16 marker after byte decoding has already happened.

References