Invisible character reference · U+FEFF

Byte Order Mark (U+FEFF)

A one-character prefix that can make a perfectly valid JSON file fail to parse and a Python script throw a SyntaxError. Here's the plain-English guide — and a one-click remover.

By NoAtMark · Published Aug 13, 2026

The short version

PropertyValue
NameByte Order Mark (BOM), also Zero Width No-Break Space
Code pointU+FEFF
UTF-8 bytesEF BB BF
AppearanceInvisible, at the very start of a file
DangerBreaks strict parsers: JSON, Python, and some tools

Why it breaks things

Editors on some platforms add a BOM to signal UTF-8 encoding. Many systems tolerate it; strict ones don't:

  • JSON. A strict parser expects the document to start with { or [. A leading BOM makes the first character unexpected, so the parse fails with "Unexpected token".
  • Python. A BOM at the start of a .py file can cause SyntaxError: invalid character in identifier or a "unexpected UTF-8 BOM" error on some interpreters/tools.
  • Data imports. A BOM in a CSV header becomes part of the first column's name.

Where it comes from

A BOM is written when a tool saves UTF-8 with signature (common on Windows Notepad, some editors, and exports). It can also ride along in copied content when a BOM character is embedded in the text.

Remove it in one click

Paste text on the left, then hit Scan to see if a U+FEFF BOM is present.

For files, drop them into the file cleaner — it strips the BOM and all other invisible characters while keeping structure.

Frequently asked questions

Is a BOM always bad?

Not always — many parsers handle it. But strict ones don't, and there's no downside to removing it when your tools complain.

How do I see a BOM?

It's invisible. A hexdump shows EF BB BF at the start; a scanner reports it by code point.

Does a BOM appear in the middle of text?

It's designed for the start, but a BOM character can appear elsewhere if copied content carried it. The scanner finds it anywhere.

References & further reading