NEW
Also known as: Byte Order Mark
A Unicode marker at the start of text indicating byte order and sometimes encoding, especially for UTF-16 and UTF-32.
DESCRIPTION
The byte order mark is the Unicode character U+FEFF used at the beginning of a text stream to signal endianness and, in some contexts, the encoding form. UTF-16 and UTF-32 commonly rely on the BOM to distinguish big-endian from little-endian byte order. UTF-8 may include a BOM, though it is neither required nor recommended in many protocols. Misplaced or unexpected BOMs can break parsers and tooling. Correct BOM handling avoids subtle interoperability issues.
ALTERNATIVE DEFINITIONS
Wikipedia
The byte order mark (BOM) is a particular use of the Unicode character U+FEFF, whose appearance at the beginning of a text stream can signal the text’s byte order and encoding form.
Details the specific code point and its signaling role for byte order and encoding.
Unicode Consortium
The byte order mark (BOM) is a Unicode character used to signal the byte order (endianness) of a text stream or file.
Authoritative Unicode guidance emphasizing endianness signaling.
RELATED TERMS
UTF-16 Unicode Endianness Encoding Detection Character Encoding Code Unit Text Stream File Signature Unicode Transformation Format
COMPETING TERMS
KNOWLEDGE AREAS
Data Integration & Interoperability Data Architecture Data Storage & Operations Data Management
TARGET AUDIENCE
Data Engineer Software Developer Data Architect Data Steward
EXTERNAL SOURCES
- Wikipedia - Byte order mark
- Unicode Consortium - Official BOM and UTF FAQ
- W3C Internationalization - BOM guidance for web content
TOP QUESTIONS
When is a BOM necessary?
It’s useful for UTF-16 and UTF-32 to indicate endianness. For UTF-8, standards often discourage using a BOM.
Category: Requirements
Why can a BOM cause problems?
Some parsers treat it as content, breaking shebangs, JSON, or headers. Unexpected BOMs can cause subtle bugs.
Category: Risks
How do I detect a BOM in files?
Check leading bytes for BOM signatures (e.g., EF BB BF for UTF-8). Many editors display or strip BOMs.
Category: HowTo
Should I use a BOM with UTF-8?
Typically no, unless a specific toolchain requires it. Protocols usually rely on headers or defaults.
Category: Opinion
What’s the relation between BOM and endianness?
BOM indicates whether multi-byte code units are stored big-endian or little-endian for UTF-16/32.
Category: Overview
How do web servers handle BOMs?
They generally ignore it, but the presence can affect content sniffing; set charset headers explicitly.
Category: Management
Can BOMs appear mid-stream?
They should not; mid-stream occurrences are typically errors or artifacts of concatenation.
Category: Mistakes
How to remove an unwanted BOM?
Use encoding-aware editors or scripts to re-encode the file without BOM, ensuring no data loss.
Category: HowTo
Is BOM the only way to signal encoding?
No. MIME charset, XML/HTML declarations, and protocol metadata often supersede BOM.
Category: Alternatives