Skip to content
OddsockLocal
Local
Source text
{
  "color": "red",
  "count": 2
}
1 wordsRuns in this browser. Nothing is uploaded.

How to use

  1. Paste the JSON into Source text, with nothing before the first brace or bracket.
  2. There is no indent control. The page only parses.
  3. Read Valid JSON, or the message that names the position, line, and column.
  4. Fix that spot in the source and paste again.

What is JSON validator?

A formatter and a viewer both refuse broken JSON, and they bury the reason under the job they were about to do. JSON validator does the parse and stops. Valid text returns the sentence Valid JSON. Invalid text returns the parser message, a character position, a line, and a column, so you can move the cursor there.

Read more

The check is syntax. It does not compare the document with a schema, and it does not pretty-print. A trailing comma, a missing comma, a bare key, or a truncated file all fail. An empty box fails because there is nothing to parse. Once the sentence says Valid JSON, the formatter, the tree, and the schema page will accept the same text.

Use cases

  • A client rejected a response body. The column of the first bad character is the place to edit.
  • A CI fixture is checked before it is committed, looking for the Valid JSON sentence.
  • Someone editing by hand removes a trailing comma and rechecks until the sentence is clean.
  • An API reviewer confirms a sample in a ticket is actually JSON before discussing the fields.
  • A log line that looks like JSON is tested on its own when the surrounding text made the parser fail earlier.

A small object that parses

{"color":"red","count":2}. A broken twin drops the comma: {"color": "red" "count": 2}.

The sample returns Valid JSON. The broken twin returns Expected ',' or '}' after property value in JSON at position 16 (line 1 column 17).

Why use Oddsock

The line and column are the repair instruction, and they show up here without a format or a tree getting in the way.

Related tools

Using this tool

The words Valid JSON. The document is not echoed. Pretty-printing is the formatter.