Skip to content
Jellykit

Byte Order Mark (BOM) Remover

Find and remove the invisible byte order mark at the start of UTF-8, UTF-16 or UTF-32 text files, or add a UTF-8 one where a program expects it.

  • Runs on your device
Loading tool

About Byte Order Mark (BOM) Remover

A byte order mark is a few invisible bytes at the very start of a text file that announce its encoding. Some programs need it: certain spreadsheet programs open a UTF-8 CSV correctly only when it has one. Many others choke on it: shell scripts with a broken first line, JSON parsers that reject the file, a stray "" at the top of a web page, or a first CSV column whose name no longer matches.

Drop one file or a whole batch. Each file is listed with the mark it carries, if any. Removing takes off exactly those bytes and leaves every other byte as it was; adding puts a UTF-8 mark in front of files that are valid UTF-8 and do not have one yet.

How it works

  1. The first few bytes of each file are compared with the five Unicode marks: EF BB BF for UTF-8, FF FE and FE FF for UTF-16, and FF FE 00 00 and 00 00 FE FF for UTF-32.
  2. Removing returns the file without those bytes. Nothing after them is decoded or rewritten, so the rest of the file is identical to the original.
  3. Adding checks that the file decodes as UTF-8 and has no mark of any kind, then writes EF BB BF in front of it.

Questions

Why does my file start with ?

Those three characters are a UTF-8 byte order mark read by a program that assumed a different encoding. Removing the mark makes them disappear.

Should I remove the mark from a UTF-16 file?

Only if the program that reads it expects UTF-16 without one. Without the mark, most programs cannot tell UTF-16 from other text, so the file may open as gibberish. For UTF-8 files the mark is almost never needed.

What happens to a file that has no mark?

When removing, it is reported as having nothing to remove and no copy is made. When adding, a file that is already marked, is UTF-16 or UTF-32, or is not valid UTF-8 is refused with the reason, rather than mislabelled.

How large can the files be?

Up to 500 MB each. Each file is read into memory in this browser, changed and offered back as a download; nothing is uploaded.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.