Free Toolkit

BOM Detector/RemoverDetect and remove Byte Order Marks (BOM) from text files.

BOM Detector/Remover illustration
🔄

BOM Detector/Remover

Detect and remove Byte Order Marks (BOM) from text files.

How to Use
1

Upload file

Drop or select a file to check for BOM.

2

View BOM status

See if a BOM is present, its type, and the encoding.

3

Remove if needed

Download the file without BOM if one was detected.

What Is BOM Detector/Remover?

BOM Detector/Remover checks files for the presence of a Byte Order Mark and lets you download a BOM-free version. A BOM is a special byte sequence at the beginning of a text file that identifies its encoding and byte order. While useful for UTF-16/32 files, a UTF-8 BOM is often unnecessary and can cause issues with scripts, PHP files, and some parsers. This tool detects BOMs for UTF-8, UTF-16 LE/BE, UTF-32 LE/BE, UTF-7, and UTF-1, shows the BOM bytes, and lets you download the file with the BOM stripped.

Why Use Our BOM Detector/Remover?

  • Detects 7 BOM types: UTF-8, UTF-16 LE/BE, UTF-32 LE/BE, UTF-7, UTF-1.
  • Shows exact BOM bytes in hexadecimal.
  • One-click BOM removal with file download.
  • Displays first bytes of the file for verification.

Common Use Cases

PHP/Script Issues

Remove UTF-8 BOM that causes "headers already sent" errors in PHP scripts.

CSV Import

Remove BOM from CSV files that causes the first column header to include invisible characters.

JSON Parsing

Fix JSON parse errors caused by BOM characters at the start of files.

Cross-Platform Compatibility

Remove BOM for consistent file handling across different operating systems and tools.

Technical Guide

The detector reads the entire file as an ArrayBuffer, then checks the first 4 bytes against known BOM sequences. BOMs are checked in order from most specific (longest) to least specific: - UTF-32 LE: FF FE 00 00 - UTF-32 BE: 00 00 FE FF - UTF-8: EF BB BF - UTF-16 LE: FF FE - UTF-16 BE: FE FF - UTF-7: 2B 2F 76 - UTF-1: F7 64 4C Note: UTF-32 LE BOM is checked before UTF-16 LE because UTF-32 LE starts with the same FF FE bytes. BOM removal creates a new ArrayBuffer slice starting after the BOM bytes. The result is downloaded as a Blob with the original filename.

Tips & Best Practices

  • 1
    UTF-8 BOM is the most common problematic BOM — it is often unnecessary.
  • 2
    Some Windows programs add UTF-8 BOM by default (e.g., Notepad).
  • 3
    BOM in CSV files can make the first column header unreadable by parsers.
  • 4
    After removal, verify the file content is still correct by opening it in a text editor.

Related Tools

Frequently Asked Questions

QWhat is a BOM?
A Byte Order Mark (BOM) is a special byte sequence at the start of a text file that identifies its Unicode encoding and byte order.
QShould I remove UTF-8 BOM?
Usually yes. UTF-8 doesn't need a BOM (it has no byte order issue), and the BOM can cause problems with PHP, JSON parsers, and some tools.
QIs it safe to remove BOM?
Yes, for UTF-8 files. For UTF-16/32 files, removing the BOM may cause encoding detection issues in some applications.
QWill removing BOM change the file encoding?
No, removing BOM only removes the marker bytes. The file content and encoding remain unchanged.
QHow do I prevent BOM from being added?
In your text editor, choose "UTF-8 without BOM" when saving. VS Code, Sublime Text, and Notepad++ have this option.

About BOM Detector/Remover

BOM Detector/Remover is a free online tool from FreeToolkit.ai. All processing happens directly in your browser — your data never leaves your device. No registration required. No ads. Just fast, reliable tools.