🧹BOM Remover

Remove byte order mark from text

How to strip a byte order mark

A BOM is the single character U+FEFF placed at the very beginning of a file to announce its encoding. You cannot see it, but it prints a blank line before PHP output, makes JSON parsing fail, and corrupts the name of the first key in a config file. On the other hand, a CSV opened in Excel often needs a BOM so that non-ASCII text is read as UTF-8. This tool strips that leading marker, or adds one when you need it.

One distinction matters. The same U+FEFF is only a BOM when it sits at the very start of the text; anywhere else it is a zero width no-break space. So the default mode removes exactly one character from the front, reports how many others were found, and leaves them alone. Choose the remove-everything mode if you really want them all gone. To clean up several kinds of invisible characters at once, a zero-width character remover fits better.

Files that were concatenated can carry a BOM at the start of inner lines too, which is why that is a separate option. You can copy the result or save it, but only saving a file writes the BOM as real bytes - the clipboard may drop it depending on the app. Lengths on screen are counted in code points, so one emoji counts as one.

Frequently asked questions

Excel shows my CSV as garbled text. Will adding a BOM fix it?

If the file is saved as UTF-8, usually yes. Pick the add-a-BOM mode, save the file, and open that file in Excel. Copying and pasting the text instead can drop the marker again.

How is this different from a zero-width character remover?

This tool focuses on the single marker at the head of a file and treats it precisely. For invisible characters scattered throughout a document, use the zero-width character remover instead.