66 chars · 5 lines
Two-way sync · Edit either side and the other updates automatically.
∅66 chars · 5 lines
Two-way sync · Edit either side and the other updates automatically.
∅JSON parser error
Unexpected end of JSON input is raised when a parser still expects more JSON syntax but the source text has already ended. The checker above starts with an intentionally truncated object so you can see how the parser location and nearby context point to an incomplete structure. This tool is free to use. No account or payment is required.
Last updated
A missing closing brace or bracket is the simplest cause, but the same message can appear when a network response is truncated, a file write stops early, a string quote never closes, or code calls JSON.parse on an empty string.
The parser reports where it finally ran out of input, so the true mistake can be earlier in the document. Work backward through the nearest still-open string, array, or object.
If the payload came from an API or file, first confirm that the producer returned the complete body. Adding a closing brace can make syntax valid while still hiding lost data from a truncated response.
The object and roles array are opened, but the source ends before the required closing delimiters are present.
{
"user": {
"name": "Ada",
"roles": ["admin", "editor"]
{
"user": {
"name": "Ada",
"roles": ["admin", "editor"]
}
}Common questions
The parser reached the end of the supplied text while it was still waiting for more valid JSON syntax, such as a closing brace, bracket, quote, or value.
Yes. Parsing an empty string is a common runtime cause, especially when an API returns no body but application code still calls JSON.parse or response.json().
No. If the source was truncated, adding punctuation may hide missing data. Verify that the complete response or file was received before repairing syntax.
Debugging a specific JSON issue? Browse JSON troubleshooting.