How to find the error in a JSON file
To find the error in a JSON file, check it with a validator that gives the line and column where it stops being valid. Open the file in Olbo's JSON tool, or paste the JSON in, and if anything is wrong it shows the place, as in "Line 12, column 5.", with one sentence about the problem and the line itself with a ^ under the spot. Fix it in the text and the status bar changes to valid.
Step by step
- Open the file in the JSON tool, or paste the JSON in.Press Open a JSON file, or drag the file onto the window. To paste instead, press "or paste some JSON" and paste into the box.
- Read where it goes wrong.Olbo shows the line and column, as in "Line 12, column 5.", then one sentence about the problem, and the line itself with a ^ under the spot. The status bar at the bottom says "not valid, line 12".
- Fix it in the text.If you opened a file, press "Go to the text and fix it" under the message first. The message under the text changes as you type, and the status bar says valid once the JSON reads.
- Press Save JSON to keep the fixed copy.Olbo writes it as a new file, and the file you opened is not changed. On a phone the button says Save.
What the JSON error messages mean
Each message says what Olbo found at that spot. "There is a comma with nothing after it." means a comma after the last item, which JSON does not allow. "A comma or a closing brace belongs here." usually means a comma is missing between two items. "A key in double quotes belongs here." usually means a key has no quotes, and "JSON strings need double quotes." means single quotes were used.
"JSON has no comments." points at a // or /* comment, which some config files allow and JSON does not. "JSON writes true, false and null in lower case." catches True, False and Null. "This string never ends." points at the quote where an unclosed string starts, and "There is more text after the end." means something comes after the end of the JSON.
Messages like "Unexpected token" come from the program that tried to read the JSON. If Olbo says "That character cannot start a value." at line 1, column 1 and the first character is <, the text is most likely a web page, such as an error page a server sent back, and not JSON at all.
When it says valid but something is off
A file can be valid JSON and still not come through whole. If a key appears twice in the same object, a browser keeps only the last one, and the status bar counts them, as in "1 repeated key". Numbers too long for a browser to hold exactly, such as 19-digit IDs, are rounded in the tree, and the status bar counts those too, as in "2 numbers rounded". The Details panel explains each under How it was read, and your text is left exactly as it was.
One mistake at a time, and very big files
Olbo shows the first mistake it finds. Fix it, and the next one, if there is one, takes its place.
For a very big file the Text view is greyed out. Olbo still shows where the mistake is, but you make the fix in a text editor and open the file again. On the Free plan Olbo opens files up to 2 MB.
More guides
Olbo is an office suite that runs in your browser. Your files are read on the machine you are sitting at and are never uploaded. See all the tools.