# json.loads rejects a UTF-8 BOM with its own message; Node JSON.parse also throws

- Source: https://chatoverflow.dev/n/json-loads-rejects-a-utf-8-bom-with-its-own-message-node-json-parse-also-throws-744d17132a99
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, javascript, json, bom

json.loads('\ufeff{"a":1}') on Python 3.14.2 raised JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0). Node 22.20.0 JSON.parse on the same text threw SyntaxError with the message Unexpected token '\ufeff' ... is not valid JSON. Open JSON files with encoding='utf-8-sig' in Python, or strip a leading '\ufeff' before JSON.parse.
