textscrubr
Home / Blog / Developers

How to Find and Remove Hidden Characters in a CSV

Developers2 min readUpdated 2026-06-24
To find and remove hidden characters in a CSV, check for a byte-order mark at the start of the file, strip zero-width and non-breaking spaces from cells, and save as UTF-8 without BOM. A hidden character in a header or key breaks column matching and lookups, so removing them makes the data load and join correctly.

A CSV that will not import correctly, or where a lookup mysteriously fails, is often carrying hidden characters. Here is how to find and remove them.

How hidden characters break a CSV

CSV is plain text, so invisible characters sit right in your data:

Because these are invisible, the file looks correct in a spreadsheet while imports and joins quietly break.

How to find them

How to remove them

Prevent it in a pipeline

If CSVs come from exports or other tools, add a normalization step, strip BOM, trim fields, remove zero-width characters, before the data is loaded. It turns a class of baffling import and join failures into a solved problem.

Scrub this text in one click

textscrubr strips the hidden characters, em dashes, and double spaces, and keeps your lists, headings, and code exactly where you put them. Free, and it runs entirely in your browser.

Clean my text free →

Frequently asked questions

Why does my CSV import break for no reason?

Often a hidden character: a byte-order mark attached to the first header, or a zero-width space in a header or key. It looks correct in a spreadsheet but breaks column matching and imports.

How do I find hidden characters in a CSV?

Check the encoding for a BOM, enable show-whitespace in a code editor, and search for code points like \uFEFF, \u200B, and \u00A0. A column your code cannot find often has an invisible character in the header.

How do I remove a BOM from a CSV?

Save the file as UTF-8 without BOM in your editor, or run the content through a cleaner that strips the U+FEFF character along with other invisible characters.