text-henkan

Add / Remove BOM

Load a file or paste text and the tool reports whether a byte order mark is present. Download the file with the BOM added or removed in one click.

or choose a file

What a BOM is

A byte order mark is a marker at the very start of a file: EF BB BF for UTF-8, FF FE for UTF-16LE and FE FF for UTF-16BE. It exists to signal UTF-16 byte order, but in UTF-8 it is used as an "this file is UTF-8" hint.

When to add one

Add a BOM when a CSV will be opened by double-clicking it in Excel, and for files read by Windows Notepad or legacy Windows software that sniffs the encoding.

When to remove one

A BOM before a shebang breaks shell scripts. In PHP it leaks into the output and triggers "headers already sent". JSON parsers, YAML loaders and many CLI tools do not expect one either, so strip it from files that programs read.

Frequently asked questions

How can I tell whether a file has a BOM?

Load it here — the leading bytes are shown in hex along with which BOM, if any, was recognised.

Does removing the BOM change the text?

No. Two or three bytes are removed from the front; the text itself is untouched.

An invisible "" keeps appearing in my file

That is a BOM. When it appears mid-file it usually came from concatenating files; strip the leading one here and check the rest with the encoding converter.

Can I remove a UTF-16 BOM?

It is not recommended — UTF-16 relies on the BOM to identify byte order, so removing it forces the reader to guess.

Related tools

Shift_JIS → UTF-8UTF-8 → Shift_JISEUC-JP → UTF-8UTF-8 → EUC-JPUTF-16 → UTF-8UTF-8 → UTF-16Encoding converterEncoding detector