A byte order mark is an invisible set of characters at the very start of a text file that tells your computer how to read the letters and symbols inside

When you save a text file — a document, a list, a piece of code — your computer stores each letter as a number. The letter "A" might be stored as 65. The letter "é" might be stored as 233. But here's the catch: different computers and different programs disagree on how to count those numbers, especially for letters outside the basic English alphabet.

A byte order mark, or BOM, is a tiny signal at the beginning of the file that says "I'm using this counting system, so read me this way." It's like a label on a box that says "contents are in French" — it doesn't change what's inside, but it tells the reader how to interpret it. Without it, your computer might guess wrong and turn your accented letters into garbage characters.

Most of the time you won't see or think about the BOM. It works silently in the background. But when you're backing up files, moving them between computers, or sharing them with someone else, understanding what it is helps you avoid the frustration of opening a file and seeing nonsense characters where real words should be.

Key Takeaways

  • A byte order mark is an invisible marker at the start of a text file that tells your computer which number system was used to encode the letters.
  • Files with accented letters, non-English characters, or special symbols are more likely to need a BOM to display correctly on different computers.
  • UTF-8 is the most common encoding today, and UTF-8 with a BOM is usually safe but not always necessary.
  • If you see strange characters when you open a backed-up file, the BOM or encoding may have been lost or misread during the save or transfer.

Why computers need to be told how to read text

Your computer doesn't actually store the letter "A" — it stores the number 65. Every letter, number, and symbol in your file is really a number underneath. The system that maps letters to numbers is called an encoding.

For decades, most computers used an encoding called ASCII, which only covered English letters, numbers, and a few symbols. ASCII worked fine if you only typed in English. But the moment you needed an accented "é" or a Chinese character or a currency symbol like "€", ASCII couldn't do it. Different countries and companies invented different ways to handle those extra characters, and they didn't all agree.

Today, most of the world has settled on UTF-8, an encoding that can handle any letter in any language. But UTF-8 comes in two flavors: with a byte order mark, and without one. The BOM is the computer's way of saying "I'm definitely using UTF-8, so don't guess."

When a byte order mark actually matters

If your file contains only plain English letters, numbers, and common punctuation, the BOM almost never matters. Your file will open the same way on almost any computer, with or without it.

The BOM becomes important when your file contains accented letters (like café or naïve), non-Latin scripts (like Arabic or Japanese), or special symbols. If the BOM is missing and your computer guesses wrong about the encoding, those characters turn into question marks or boxes or random symbols.

The BOM also matters when you're moving files between different operating systems — Windows, Mac, Linux — or between different programs. Some programs write the BOM automatically. Others don't. Some programs read it correctly. Others ignore it. When you back up a file and then open it on a different computer or in a different program, a missing or misread BOM is one of the most common reasons the file looks corrupted.

How different programs handle the byte order mark

Microsoft Word and Google Docs usually don't show you the BOM at all — they handle it behind the scenes. If you save a Word document as a plain text file (.txt), Word will add a BOM if the file contains non-English characters.

Text editors like Notepad (Windows), TextEdit (Mac), or Sublime Text give you a choice. When you save a file, you can usually pick the encoding from a menu. If you pick "UTF-8 with BOM", the editor adds the marker. If you pick "UTF-8 without BOM", it doesn't. Most modern text editors default to UTF-8 without BOM, which is fine for most uses.

Spreadsheet programs like Excel and Google Sheets also handle the BOM automatically. If you export a spreadsheet as a CSV file (comma-separated values), the program may or may not add a BOM depending on your settings and which program you're using.

What happens when the byte order mark is lost or wrong

When you back up a file, copy it to a USB drive, email it, or upload it to cloud storage, the BOM usually travels with it. But not always. Some backup tools or file transfer methods strip it out. Some programs that read the file don't preserve it when they save a new copy.

If the BOM is lost and your file contains accented or non-English characters, the receiving computer has to guess which encoding was used. If it guesses wrong, you'll see mojibake — the technical term for garbled text. An "é" might become "é" or "?". A Chinese character might become a box.

The fix is usually straightforward: open the file in a text editor, tell the editor which encoding to use, and save it again. Most text editors have a menu option like "Encoding" or "Character Set" where you can pick UTF-8 and re-save. But you have to know the problem exists first.

How to check and set the byte order mark in your files

On Windows, open a file in Notepad. Go to File > Save As. At the bottom of the dialog, you'll see "Encoding" with a dropdown menu. The options usually include "UTF-8", "UTF-8 with BOM", "ANSI", and others. Pick "UTF-8 with BOM" if your file has non-English characters, then save. The BOM will be added.

On Mac, open a file in TextEdit. Go to Format menu and make sure "Plain Text" is selected (not Rich Text). Then go to File > Save. In the dialog, look for an "Encoding" dropdown near the bottom. Pick "UTF-8" or "UTF-8 with BOM", then save.

In most text editors on any system — Sublime Text, Visual Studio Code, Notepad++, or others — you can see the current encoding in the status bar at the bottom of the window. Click on it to change it. After you change the encoding, save the file and the new encoding will be applied.

For spreadsheets, the process is different. In Excel, when you export to CSV, go to File > Save As, pick CSV format, and click Save. Excel will ask you about encoding. Choose "UTF-8" or "UTF-8 with BOM" depending on where the file is going. In Google Sheets, go to File > read > Comma Separated Values, and the file downloads with UTF-8 encoding.

Byte order marks and file backups

When you back up text files, the BOM usually stays intact if you're using a standard backup method — copying files to an external drive, uploading to cloud storage, or using backup software. The BOM is just part of the file, so it travels along.

The risk comes when you open a backed-up file, edit it in a different program, and save it again. If the new program doesn't preserve the BOM, it will be lost. The next time someone opens the file on a different computer, they might see garbled characters.

To protect yourself: if you're backing up files that contain non-English characters, open one of them after the backup is complete and check that the characters still look right. If they do, the backup preserved the encoding correctly. If they don't, you know to re-save the files with the correct encoding before backing them up again.

Frequently Asked Questions

What does BOM stand for?

BOM stands for byte order mark. A byte is the smallest unit of computer storage — eight bits. The "order" refers to the order in which bytes are arranged to represent a character. The "mark" is the invisible signal at the start of the file that tells the computer which order to expect.

Can I remove the byte order mark from a file?

Yes. Open the file in a text editor, go to the encoding menu, and save it as "UTF-8 without BOM" instead of "UTF-8 with BOM". The BOM will be removed. This is safe for most files, but if the file will be opened on very old computers or in older programs, keeping the BOM can prevent problems.

Does the byte order mark make files bigger?

A byte order mark adds only 3 bytes to a file — a tiny amount. For a text file of any reasonable size, you won't notice a difference in file size. It's not a reason to avoid using one if your file contains non-English characters.

Why do some programs ignore the byte order mark?

Some older programs were written before UTF-8 and the BOM became standard, so they don't know how to read it. Some programs assume all files are in a specific encoding and don't bother checking the BOM. Modern programs almost always read it correctly.

If I'm only using English, do I need to worry about the byte order mark?

No. Plain English text works fine with or without a BOM. The BOM only matters when your file contains accented letters, non-Latin scripts, or special symbols that ASCII encoding can't handle. If you're writing in English only, you can ignore it.