JSONL Error Dictionary
Every JSON parsing error explained in plain English with before-and-after fixes. Stop guessing - find your error, understand the cause, and fix it in seconds.
Trailing Comma
#trailing-comma
What your parser says:
Expected double-quoted property name in JSON at position 32In Plain English
You have an extra comma after the last property in an object or the last item in an array. JavaScript allows trailing commas, but JSON does not. The parser reaches the comma, expects another value, and finds a closing bracket instead.
Before (Invalid)
{"name":"Alice","age":30,}After (Valid)
{"name":"Alice","age":30}Common Causes
- Copying JSON from JavaScript source code where trailing commas are valid
- Deleting a property but leaving its comma behind
- Code generators or templates that add a comma after every item including the last
- Editing JSON by hand and forgetting to clean up
Unquoted Property Names
#unquoted-keys
What your parser says:
Expected property name or '}' in JSON at position 1In Plain English
JSON requires all property names (keys) to be wrapped in double quotes. Unlike JavaScript objects, you cannot use bare identifiers as keys. The parser sees a letter where it expects a quote character.
Before (Invalid)
{name:"Alice",age:30}After (Valid)
{"name":"Alice","age":30}Common Causes
- Writing JavaScript object literal syntax instead of JSON
- Using Python dict output without json.dumps()
- Hand-editing JSON and forgetting quotes around keys
- YAML-to-JSON conversion that did not quote keys
Single Quotes Instead of Double
#single-quotes
What your parser says:
Unexpected token ' in JSON at position 1In Plain English
JSON only allows double quotes (") for strings. Single quotes (') are not valid in JSON, even though they work in JavaScript and Python. Every string - both keys and values - must use double quotes.
Before (Invalid)
{'name':'Alice','age':30}After (Valid)
{"name":"Alice","age":30}Common Causes
- Using Python's str() or repr() on a dict instead of json.dumps()
- Copying from a JavaScript console that displays objects with single quotes
- Hand-writing JSON with a habit of using single quotes
- Template engines that output single-quoted strings
Unexpected End of JSON Input
#incomplete-json
What your parser says:
Unexpected end of JSON inputIn Plain English
The JSON string ends before the parser found everything it expected. Usually this means a missing closing brace }, bracket ], or quote ". The parser ran out of characters while still inside a structure.
Before (Invalid)
{"name":"Alice","age":30After (Valid)
{"name":"Alice","age":30}Common Causes
- Truncated data from a network timeout or interrupted download
- Missing closing brace or bracket after the last property
- Multi-line JSON spread across multiple lines in a JSONL file
- Buffer size limit cutting off the line mid-value
Unterminated String
#unterminated-string
What your parser says:
Unterminated string in JSON at position 8In Plain English
A string value was opened with a double quote but never closed. The parser reached the end of the line (or the end of the input) while still inside a string. This usually means a missing closing quote or an unescaped quote inside the string.
Before (Invalid)
{"name":"Alice, "age":30}After (Valid)
{"name":"Alice","age":30}Common Causes
- Missing closing double quote on a string value
- Unescaped double quote inside a string value (use
\") - Newline character inside a string (must use
\ninstead) - String contains a tab character that was not escaped as
\t
Unescaped Control Characters
#bad-control-character
What your parser says:
Bad control character in string literal in JSON at position 15In Plain English
There is an invisible control character (like a tab, newline, or backspace) inside a JSON string that has not been properly escaped. JSON requires these characters to use escape sequences like \n, \t, or \uXXXX.
Before (Invalid)
{"bio":"Line one[TAB]Line two"}After (Valid)
{"bio":"Line one\tLine two"}Common Causes
- Tab characters pasted from a spreadsheet or text editor
- Literal newlines inside a JSON string value (use \n instead)
- Form feed, backspace, or null bytes from binary data
- Data copied from PDFs or word processors containing hidden characters
Invalid Token at Position 0
#invalid-token
What your parser says:
Unexpected token u in JSON at position 0In Plain English
The very first character of the line is not valid JSON. JSON values must start with {, [, ", a digit, or one of the literals true, false, null. The parser found something completely unexpected at the start.
Before (Invalid)
undefinedAfter (Valid)
{"status":"ok"}Common Causes
- Trying to parse
undefinedor an empty string - A BOM character at the start of the file (see BOM Character)
- HTML error page returned instead of JSON data
- Server returned a plain text error message instead of JSON
Duplicate Keys in Object
#duplicate-keys
What your parser says:
Duplicate key "name" (may silently overwrite - behavior varies by parser)In Plain English
The same key name appears more than once in a single JSON object. While technically allowed by the JSON spec, it causes unpredictable behavior. Most parsers silently use the last value, but some use the first or throw an error. This is almost always a mistake.
Before (Problematic)
{"name":"Alice","age":30,"name":"Bob"}After (Valid)
{"name":"Alice","age":30}Common Causes
- Merging two JSON objects by concatenation instead of proper merge
- Copy-paste errors when editing JSON by hand
- Code generator producing the same field twice
- Different code paths both writing the same key to a dictionary
BOM (Byte Order Mark) at Start
#bom-character
What your parser says:
Unexpected token <U+FEFF> in JSON at position 0In Plain English
The file starts with an invisible character called a Byte Order Mark (BOM, U+FEFF). This 3-byte sequence (EF BB BF in UTF-8) is added by some text editors like Windows Notepad to mark the file encoding. JSON parsers do not expect it and fail on the very first character.
Before (Invalid)
[BOM]{"name":"Alice","age":30}After (Valid)
{"name":"Alice","age":30}Common Causes
- File saved with Windows Notepad (adds BOM by default in older versions)
- Excel or other Microsoft tools exporting to CSV/text with BOM
- PHP files that include a BOM before JSON output
- Concatenating files where one has a BOM header
Inconsistent CR/LF Line Endings
#mixed-line-endings
What your parser says:
Unexpected token \r in JSON at position 28In Plain English
Your JSONL file has a mix of Windows-style (\r\n) and Unix-style (\n) line endings. Some parsers that split on \n will leave a stray carriage return (\r) at the end of each line, causing a parse error on what looks like perfectly valid JSON.
Before (Problematic)
{"name":"Alice"}\r\n
{"name":"Bob"}\nAfter (Valid)
{"name":"Alice"}\n
{"name":"Bob"}\nCommon Causes
- File edited on both Windows and macOS/Linux without normalizing line endings
- Git autocrlf settings converting line endings inconsistently
- Appending data from different operating systems to the same file
- FTP transfer in ASCII mode corrupting line endings
Array Brackets vs Object Braces Confusion
#wrong-brackets
What your parser says:
Expected ',' or ']' in JSON at position 6In Plain English
You used square brackets [ ] where curly braces { } were needed, or the other way around. Arrays use brackets and hold ordered values. Objects use braces and hold key-value pairs. Mixing them up causes the parser to expect the wrong kind of content.
Before (Invalid)
["name":"Alice","age":30]
After (Valid)
{"name":"Alice","age":30}Common Causes
- Wrapping a JSONL file in array brackets (JSONL records are standalone, not array items)
- Confusing JSON array format with JSONL format
- Mismatched opening and closing brackets after manual editing
- Starting an object with
[instead of{
Leading Zeros in Numbers
#leading-zeros
What your parser says:
Unexpected number in JSON at position 7In Plain English
JSON does not allow numbers with leading zeros like 007 or 01.5. The only number that can start with zero is 0 itself (and decimals like 0.5). Leading zeros are ambiguous because some languages treat them as octal notation.
Before (Invalid)
{"id":007,"score":09}After (Valid)
{"id":7,"score":9}Common Causes
- Zero-padded IDs exported from databases (e.g., employee ID "007")
- Zip codes or phone numbers stored as numbers instead of strings
- Formatting numbers with leading zeros for display alignment
- Octal notation from C-like languages leaking into JSON output
Unexpected Number in JSON
#unexpected-number
What your parser says:
Unexpected number in JSON at position 12In Plain English
A number appeared where the parser did not expect one. This usually means a missing comma between values, a colon missing between a key and value, or a number used where a string key was expected. The parser found digits where it needed punctuation or a quoted string.
Before (Invalid)
{"age":30 50}After (Valid)
{"age":30,"score":50}Common Causes
- Missing comma between two key-value pairs
- Missing colon between a key and its numeric value
- Two numbers next to each other in an array without a comma
- Leading zeros causing the parser to see two separate numbers (see Leading Zeros)
Unexpected String in JSON
#unexpected-string
What your parser says:
Unexpected string in JSON at position 18In Plain English
A quoted string appeared where the parser did not expect one. This usually means a missing comma between two values, or two string values placed next to each other without proper separation. The parser found a quote character where it expected a comma, colon, or closing bracket.
Before (Invalid)
{"name":"Alice" "age":"30"}After (Valid)
{"name":"Alice","age":"30"}Common Causes
- Missing comma between two key-value pairs
- Concatenating two JSON objects without a comma separator
- Missing colon between a key and its string value
- Extra closing quote causing the parser to end a string early
Quick Reference
| Error | Quick Fix |
|---|---|
| Trailing Comma | Remove the comma before the closing } or ] |
| Unquoted Keys | Wrap all property names in double quotes |
| Single Quotes | Replace all single quotes with double quotes |
| Incomplete JSON | Add the missing closing } or ] |
| Unterminated String | Add the missing closing double quote |
| Control Characters | Escape tabs as \t and newlines as \n |
| Invalid Token | Ensure the line starts with valid JSON ({, [, ") |
| Duplicate Keys | Remove or rename one of the duplicate keys |
| BOM Character | Re-save the file as UTF-8 without BOM |
| Mixed Line Endings | Normalize all line endings to LF (\n) |
| Wrong Brackets | Use { } for objects and [ ] for arrays |
| Leading Zeros | Remove leading zeros or use strings for zero-padded IDs |
| Unexpected Number | Add the missing comma or colon before the number |
| Unexpected String | Add the missing comma or colon before the string |
Ready to Fix Your JSONL?
Paste your data into the validator and get instant error detection with line numbers, auto-fix suggestions, and downloadable results.
Open the JSONL Validator