BOM Processor
Online BOM processor for detecting, adding, and removing UTF-8/UTF-16/UTF-32 byte order marks, useful for script error troubleshooting and config file compatibility fixes.
Input
Operations
Select BOM type to add
Note: Adding BOM may break compatibility with older compilers, script runtimes, or config parsers.
BOM Guide and Practice
BOM (Byte Order Mark) identifies text encoding and byte order. This tool helps you detect, add, and remove common BOM bytes for scripts, configs, and cross-platform text handling.
What is BOM?
BOM is a special byte sequence at the beginning of a text file used to signal encoding details.
Why errors happen
Some runtimes and parsers cannot handle UTF-8 BOM, causing script execution or JSON parsing failures.
When to add BOM
Add BOM when a receiving system explicitly expects encoding markers for import or display behavior.
When to remove BOM
Remove BOM when shebang, signatures, or parser behavior break in deployment and integration workflows.
Common BOM Types
| Encoding | BOM Bytes | Length | Notes |
|---|---|---|---|
| UTF-8 | EF BB BF | 3 bytes | Common in Windows-generated text files |
| UTF-16 LE | FF FE | 2 bytes | Little-endian |
| UTF-16 BE | FE FF | 2 bytes | Big-endian |
| UTF-32 LE | FF FE 00 00 | 4 bytes | Little-endian |
| UTF-32 BE | 00 00 FE FF | 4 bytes | Big-endian |
| UTF-7 | 2B 2F 76 | 3 bytes | Legacy encoding, rarely used |
| UTF-1 | F7 7F | 2 bytes | Legacy encoding, obsolete |
Common Issues
Unexpected leading characters in PHP/ASP
This is often caused by UTF-8 BOM. Removing BOM usually fixes output anomalies.
Python/Shell shebang not working
A BOM before the first line can prevent interpreters from reading shebang correctly.
JSON or config parsing fails
Some parsers reject BOM-prefixed content. Remove BOM before parsing.