BOM Remover & Adder
Find out whether a file starts with a byte order mark and which one: UTF-8, UTF-16, UTF-32 or a rarer signature. Remove it, add a UTF-8 BOM so Excel reads accents correctly, or convert UTF-16 and UTF-32 files to UTF-8. Catches double BOMs and BOMs stuck in the middle of joined files. Works on many files at once, in your browser.
How to Use
- Drop one or more files on the box (or use browse), paste text under Or paste text, or press a preset to load a sample file.
- Read the verdict for each file: which byte order mark it starts with (if any), whether it appears twice, and whether a U+FEFF is hiding further in. The picture shows the first 16 bytes with the BOM coloured.
- Choose what to do: Remove BOM, Add UTF-8 BOM (for CSV files opened in Excel), or Convert to UTF-8 for UTF-16 and UTF-32 files. Tick Also remove U+FEFF inside the file to clean joined files.
- Press Download next to a file, or Download all. Each file keeps its original name, and the list shows its size before and after.
- Check Show Work below the tool for what was found in the selected file, at which byte offsets, and how the new size was worked out.
Or paste text
Files
Worked Example
A CSV that shows é in Excel. The file customers.csv holds two lines, name,city and José,Málaga, with Windows line endings: 26 bytes of UTF-8 and no BOM. The é is stored as C3 A9 and the á as C3 A1. Double-clicked in Excel on a Western-language PC, the file is read as Windows-1252, one byte per character, so the cells show José and Málaga. Add UTF-8 BOM puts EF BB BF in front: 26 + 3 = 29 bytes, every other byte unchanged, and Excel now reads it as UTF-8.
JSON an API rejects, and a PHP page that cannot send headers. {"ok":true} is 11 bytes; saved by an editor that adds a BOM it is 14, starting EF BB BF 7B. Python’s json.loads on the decoded text raises “Unexpected UTF-8 BOM (decode using utf-8-sig)”, and JSON.parse in JavaScript stops at the first character. Remove BOM returns it to 11 bytes. A PHP file with the same 3 bytes before <?php sends them to the browser as output, so a later header('Location: /login') fails with “headers already sent (output started at …:1)”; the 37-byte sample becomes 34.
The common mistakes: adding a BOM twice, and reading FF FE 00 00 as UTF-16. Running an “add BOM” step on a file that already has one gives EF BB BF EF BB BF. A decoder removes only the first; the second stays as an invisible U+FEFF glued to the first header, so a column named id is no longer found. The 23-byte sample has two BOMs; removing both leaves 17 bytes (23 − 2 × 3). The second trap is order: the UTF-32 LE mark FF FE 00 00 starts with the UTF-16 LE mark FF FE, so a detector that checks UTF-16 first calls every UTF-32 LE file UTF-16 and decodes it as text full of NULs. This tool tests the 4-byte signatures first, then checks that the bytes after them really are UTF-32.
Show Work
U+FEFF in Every Encoding
Where the Byte Order Mark Came From
Unicode began as a 16-bit code, and 16-bit numbers are stored high byte first on some computers and low byte first on others. So the standard set aside a character that reads differently each way: U+FEFF, whose byte-swapped form U+FFFE is guaranteed never to be a character. In Unicode 1.0 (1991) it was named BYTE ORDER MARK, and the Unicode Character Database still lists that as its Unicode 1.0 name; it now carries the ISO/IEC 10646 name ZERO WIDTH NO-BREAK SPACE, because it also meant “do not break the line here”. That double meaning caused trouble, since a mark that is also a character cannot safely be deleted. Unicode 3.2 (2002) added U+2060 WORD JOINER to take over the no-break job, and the standard now says the word-joining use of U+FEFF exists only for backward compatibility.
UTF-8 has no byte order, so in UTF-8 the three bytes EF BB BF serve only as a signature saying “this is UTF-8”. Up to version 15.1 the Unicode Standard said a BOM in UTF-8 is “neither required nor recommended”; since version 16.0 (2024) it says the standard “does not recommend for or against” one, and warns that some tools fail to handle it. RFC 3629, the UTF-8 specification, adds that a U+FEFF anywhere but the start must be treated as a character, never as a signature. Protocols decide for themselves: RFC 8259 says JSON sent between systems must not start with a BOM, though parsers may ignore one.
Windows is where most BOMs come from. Notepad added one to every UTF-8 file it saved until a 2018 Windows 10 preview (build 18298) made “UTF-8 without BOM” the default for new files, citing compatibility with the web. Windows PowerShell 5.1 writes a BOM with every Unicode encoding, and its > redirection writes UTF-16 LE; PowerShell 6 and later default to UTF-8 without one. Excel goes the other way, opening a UTF-8 CSV correctly only when it has a BOM. Two kinds of program break on it: PHP sends anything before <?php as output, so a BOM triggers “headers already sent”, and Unix only recognises a script’s #! line when those are the first two bytes, which the Unicode FAQ itself warns about.
About This Tool
This tool reads files as bytes, not text, so it sees exactly what a parser sees. It recognises the five Unicode byte order marks and six rarer signatures (GB18030, UTF-EBCDIC, UTF-7, SCSU, BOCU-1 and UTF-1), tells UTF-32 LE apart from UTF-16 LE, and finds double BOMs, a BOM that was turned into the visible text , and U+FEFF characters in the middle of joined files. Files without a BOM get a reasoned guess: plain ASCII, valid UTF-8, UTF-16 or UTF-32 judged by the pattern of zero bytes, or a legacy code page. It removes BOMs, adds a UTF-8 BOM only to files that really are UTF-8, and converts UTF-16, UTF-32 and GB18030 to UTF-8 when asked, saying clearly that this re-encodes the whole file. Each file keeps its name, and many can be handled at once.
Everything runs in your browser; no file is uploaded or stored. Large files are inspected from their first 64 KB and rewritten from slices of the original, so they are not copied into memory. It is for developers fixing JSON, PHP and script files, and for anyone whose spreadsheet export shows é instead of é.
Related tools: Mojibake Repair Lab, Text Encoding Converter, and Hex Editor & Viewer.
Frequently Asked Questions
What is a byte order mark (BOM)?
It is the character U+FEFF placed at the very start of a text file as a signature. Its bytes depend on the encoding, so they tell a program how the rest of the file is stored: EF BB BF means UTF-8, FF FE UTF-16 little-endian, FE FF UTF-16 big-endian, FF FE 00 00 UTF-32 little-endian and 00 00 FE FF UTF-32 big-endian. Most editors hide it, which is why it causes confusing errors: the file looks fine but its first three bytes are not what a parser expects.
Should I remove the BOM or keep it?
Remove it from anything a program parses from the first byte: JSON sent over a network (RFC 8259 says implementations must not add one), PHP files (the BOM is sent as output and causes “headers already sent”), shell scripts (the #! line stops working), and most config files. Keep or add a UTF-8 BOM on a CSV file that people open by double-clicking in Excel, because Excel only reads a CSV as UTF-8 when the BOM is there. UTF-16 and UTF-32 files need it more than UTF-8 does, because without it the byte order is a guess.
Why does Excel show é instead of é?
Excel opens a UTF-8 CSV correctly only when it begins with a BOM; without one it reads the bytes in the computer’s legacy code page, Windows-1252 on a Western-language PC. The letter é is the two UTF-8 bytes C3 A9, which Windows-1252 shows as à and ©. Adding the 3-byte UTF-8 BOM fixes it without changing anything else in the file. If the CSV is not UTF-8 to begin with, the tool says so instead of adding a BOM that would make things worse.
What is a double BOM, and why do I see  in my text?
A double BOM is EF BB BF EF BB BF: a BOM was added to a file that already had one. Decoders remove only the first, so the second becomes an invisible character at the start of the first value; a CSV column called “id” is then really “id” and lookups by name fail. The visible  is the same three bytes read as Windows-1252, and if that text was then saved as UTF-8 again it became six bytes, C3 AF C2 BB C2 BF. This tool finds both cases, plus BOMs left in the middle of files that were joined together, and removes them.
Are my files uploaded? How large can they be?
Nothing is uploaded; everything runs in your browser. Only the first 64 KB of each file is decoded to identify it, and the rest is scanned for stray U+FEFF in 8 MB pieces. Removing or adding a BOM builds the new file from slices of the original, so even a file of several gigabytes is not copied into memory. Converting UTF-16 or UTF-32 to UTF-8 does have to decode every character, so that takes longer on very large files.
How do I use the BOM Remover & Adder?
Simply type your numbers and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.
Does it cost anything or need an account?
No. The tool is completely free, there is no account to create, and it keeps working offline after the page first loads.
Is anything I type uploaded?
No. The tool works entirely on your device, so the values you enter never leave your browser.
Common Use Cases
CSV files for Excel
Add a UTF-8 BOM so names like José and Málaga open correctly instead of as José and Málaga: the 26-byte sample becomes 29 bytes and nothing else changes.
JSON an API rejects
Strip the BOM that Windows tools put in front of JSON. Python’s json.loads raises “Unexpected UTF-8 BOM” and JavaScript’s JSON.parse fails on the first character; a 14-byte file becomes 11.
PHP “headers already sent”
A BOM before <?php is output, so every later header() and session_start() fails with “output started at file.php:1”. Removing the 3 bytes fixes it.
Exports from Windows tools
Windows PowerShell 5.1’s > redirection and Out-File write UTF-16 LE, which git and grep treat as binary because every other byte is zero. Convert them to UTF-8: the 50-byte sample becomes 26 bytes.
Joined and repeated files
Concatenated CSV exports carry a BOM at the start of every part. The tool lists each one by byte offset and removes them all, along with double BOMs at the start.
Last updated: