Quick answer
A BOM (Byte Order Mark) at the start of a UTF-8 file can make the first field name not match (e.g.
CSV BOM Character
A BOM (Byte Order Mark) at the start of a UTF-8 file can make the first field name not match (e.g. "\ufeffname" instead of "name").
Common causes
- File saved with UTF-8 BOM in editor or export.
- First column name not matching in code.
How to fix
- Save CSV without BOM (UTF-8 without BOM).
- Strip BOM when reading: remove leading \ufeff if present.
- Validate with a CSV validator to confirm encoding.
Examples
Bad
name,age Alice,30
Good
name,age Alice,30
FAQ
- What is BOM?
- Byte order mark; optional at start of UTF-8 file.
- Should I use BOM for CSV?
- Usually no; strip it when reading if present.
Fix it now
Try in validator (prefill this example)