Skip to main content

Check and Remove Byte Order Marks Online Detect 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.

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.

Loading tool...

What Is BOM Detector/Remover?

BOM Detector/Remover checks files for the presence of a Byte Order Mark and lets you download a version without it. It 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 marker is often unnecessary and can cause issues with scripts, PHP files, and some parsers. This tool detects these markers for UTF-8, UTF-16 LE/BE, UTF-32 LE/BE, UTF-7, and UTF-1, shows the marker bytes, and lets you download the file with it stripped.

Why Use 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. Markers 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 marker is checked before UTF-16 LE because UTF-32 LE starts with the same FF FE bytes.

Removal creates a new ArrayBuffer slice starting after the marker 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

Q What 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.
Q Should 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.
Q Is 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.
Q Will removing BOM change the file encoding?
No, removing BOM only removes the marker bytes. The file content and encoding remain unchanged.
Q How 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 This Tool

BOM Detector/Remover is a free online tool by FreeToolkit.ai. All processing happens directly in your browser โ€” your data never leaves your device. No registration or installation required.