BOM checker
Detect a byte order mark in a local file or pasted bytes: recognises UTF-8 (EF BB BF), UTF-16LE/BE, UTF-32LE/BE, GB18030 and more, then shows the BOM hex, the text without it, per-encoding character counts and a BOM-removed result.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Text is encoded as UTF-8 before detection; hex accepts spaces, commas, colons and 0x / \x prefixes; Base64 also accepts the URL-safe alphabet.
The file is read locally with FileReader; only the first 4096 bytes are used and nothing is uploaded.
Detection result
Matched against real BOM bytes with longest-signature-first order (UTF-32 before UTF-16); character counts use the bytes after the BOM.
Paste content or pick a file to detect a BOM
What this tool does
- Check whether a text, CSV or script file starts with a UTF-8 BOM (EF BB BF) when Excel shows mojibake or a hidden character in the first column
- Paste a file header to tell UTF-16LE (FF FE), UTF-16BE (FE FF) and UTF-32 apart, including the prefixes that are easy to confuse
- Get the hex and the text after the BOM is removed, so you can compare the with-BOM and without-BOM versions
Example
Input
EF BB BF E4 BD A0 E5 A5 BD
Output
format: hex bom: utf-8 (EF BB BF) bytes: 9 body-bytes: 6 decoded-as: utf-8 characters: 2 text: 你好 utf-8: 2 utf-16le: 3 utf-16be: 3 utf-32le: 2 (invalid) utf-32be: 2 (invalid) body-hex: E4 BD A0 E5 A5 BD
Pick the "Hex byte string" input format. The first 3 bytes match the UTF-8 BOM; the remaining 6 bytes decode to "你好" and every character count is computed on those 6 bytes.
Frequently asked questions
How is the BOM detected?
By matching real byte prefixes with longest signature first: UTF-32LE (FF FE 00 00) and UTF-32BE (00 00 FE FF) are tested before UTF-16LE (FF FE), UTF-16BE (FE FF) and finally UTF-8 (EF BB BF), so FF FE 00 00 is never mistaken for UTF-16LE. Rare BOMs such as UTF-7, GB18030, SCSU, BOCU-1, UTF-1 and UTF-EBCDIC are recognised too, but their payload is not decoded here and falls back to UTF-8.
How should I read the per-encoding character counts?
The bytes after the BOM are decoded with UTF-8, UTF-16LE, UTF-16BE, UTF-32LE and UTF-32BE and then counted in code points (a surrogate pair counts as one character). Only the row matching the real encoding is meaningful; invalid on another row means that encoding cannot parse those bytes and U+FFFD was substituted.
Does it read or upload my file?
No network access. When you pick a file the browser reads it locally with FileReader and only the first 4096 bytes are converted to hex, so even huge files answer instantly and the BOM check is unaffected. Pasted content is processed in the browser as well.
Can I save the "BOM removed" result back to a file?
The result gives both the text without the BOM and its hex form, and the text is copyable. For a UTF-16/UTF-32 file you get decoded characters, so you still have to write the file with the target encoding yourself; this tool never writes files back.
Can it guess the encoding when there is no BOM?
No. This tool only detects BOMs and does not guess unmarked encodings such as GBK or Shift_JIS: without a BOM the bytes are decoded as UTF-8, and U+FFFD means they are not valid UTF-8, so you need a dedicated encoding detector.
Keywords:BOM检测文件BOMUTF-8 BOMEF BB BF移除BOM字节序标记BOM checkerbyte order markUTF-16LE