BOM Detector
Check whether an uploaded file starts with a Byte Order Mark (UTF-8, UTF-16-LE, UTF-16-BE, UTF-32). Useful for encoding issues.
Aguardando arquivo…
Finding the encoding from the first bytes
Some text files begin with a byte order mark, three to four bytes declaring the encoding before the first real character. It is effectively mandatory for UTF-16 and UTF-32, where it indicates byte order, and optional in UTF-8, where it merely hints. Since those bytes are invisible in any editor, a file with an encoding problem gives no clue at all on screen.
Pick the file and the page reads its beginning and identifies the mark: UTF-8, UTF-16 in either order, or UTF-32 in either order. When there is no mark, it says so — which does not mean the file is UTF-8, only that it does not declare itself. The file is read in your own browser and is not sent anywhere.
The order of the checks matters more than it seems. The UTF-32 little-endian mark starts with the same two bytes as the UTF-16 little-endian mark, so testing UTF-16 first would misclassify every UTF-32 file. That is why the four-byte patterns are checked before the two-byte ones — a detail easy to get wrong in a hand-rolled implementation.
Frequently asked questions
Does no mark mean UTF-8?
Should I remove the UTF-8 mark?
Can encoding be detected without a mark?
Related Tools
Line Ending Detector (LF/CRLF/CR)
Detect whether a text uses LF (Unix), CRLF (Windows) or CR (classic Mac), and how many of each appear.
Character Info
Get full information about any Unicode character: decimal code, hex, HTML entity, UTF-8 and official name. Click any character to inspect it.
Strip BOM
Remove the Byte Order Mark (\uFEFF) from pasted text. Fixes common issues with Excel-generated CSVs.
CNAB File Reader
Read Brazilian CNAB 240 and CNAB 400 banking files and display records decomposed by type.
Bookmarklet Builder
Wraps a JavaScript snippet as a bookmarklet (javascript: link) ready to drag to the bookmarks bar.
Blank Screen
Fully white screen for projecting, cleaning the display or using as a focus background. Supports dark mode.