---
title: "JSON Syntax Checker: Find & Fix JSON Errors Online | Prettify"
description: "Find JSON syntax errors by line and column, then fix the common
  ones: trailing commas, single quotes, unquoted keys, and missing commas. Free,
  with no upload."
url: https://prettify.tools/json-syntax-checker
---

# JSON Syntax Checker

JSON that fails to parse is usually one small mistake: a stray comma, a wrong quote, a missing bracket. Paste your text and the checker shows where it stops. Then the paste dialog can repair the usual mistakes for you, with a fix for each one and an Undo if you change your mind.

## What the JSON syntax checker does

The checker has two jobs. First, it finds the place where your text stops being JSON. Second, it names the mistake in plain words and offers a repair when the mistake is a common one.

The box at the top of this page does the first job. It shows the line and column of the first error. The second job happens in the editor. Select Fix it in the editor, and the paste dialog lists each problem with its position, a short explanation, and a Fix button.

## Mistakes it can repair

The Fix all button in the paste dialog repairs these mistakes in one pass. The Fix button on a single row repairs just that one. Each repair is a small, exact edit to the text, so the rest of your document does not change.

- Trailing commas, such as \[1, 2,]. The comma is removed.
- Single-quoted strings, such as 'name'. The quotes become double quotes.
- Curly quotes copied from a document or a chat window. They become straight double quotes.
- Unquoted keys, such as name: "Ada". The key is wrapped in double quotes.
- Missing commas between two items. A comma is added.
- Python values (True, False, None), MongoDB shell types (ObjectId, NumberLong, ISODate), and JSONP wrappers such as callback({...}). A second repair step converts these.

## Reading the error messages

When a mistake is not one of the common ones, the box shows the parser message. A short message is easier to act on when you know what causes it. These are the ones you will meet, with their usual cause.

- Expected comma (,) or closing bracket: a comma is missing. The position is the start of the next item.
- Unterminated string: a closing quote is missing. The position is where the string starts.
- Expected closing bracket (]): the text ends too soon, often because a copy was cut off.
- Expected colon (:) after property name: a key has no colon before its value.
- Invalid symbol: a character that JSON does not allow here, such as an unquoted key, NaN, or True.
- More than one JSON document: several values on separate lines. Wrap them in an array, or open them as JSON Lines.

## How to check and fix JSON syntax

Start with the box on this page, then finish in the paste dialog. The box runs in your browser and takes documents up to 512 KB. Larger documents go straight to the editor, which handles big files.

1. Paste your JSON into the box at the top of this page, or select Try an example.
2. Read the red message. Note the line and column.
3. Select Fix it in the editor. The paste dialog opens with your text and its problems.
4. Select Ln and the position beside a problem to jump to it, or select Fix to repair that one problem.
5. Select Fix all to repair every problem it can. A green line reports how many it fixed, with an Undo link.
6. Select Format in the dialog to load the repaired document.

## Worked example: a hand-edited settings file

Say someone edited a settings file by hand and made four mistakes. The box reports Line 2, column 3: Invalid symbol, because the first key has no quotes.

In the paste dialog, each problem gets a clear name: Unquoted property name "name", Single-quoted string, Trailing comma, and Missing comma. Fix all repairs the four of them together and gives the result below.

```
Input
{
  name: "Ada",
  'role': "admin",
  "tags": ["a", "b",],
  "active": true
  "retries": 3
}

Problems in the paste dialog
Ln 2:3  Unquoted property name "name"
Ln 3:3  Single-quoted string
Ln 4:20 Trailing comma
Ln 6:3  Missing comma

After Fix all
{
  "name": "Ada",
  "role": "admin",
  "tags": [
    "a",
    "b"
  ],
  "active": true,
  "retries": 3
}
```

## Comments are a special case

Strict JSON has no comments. The box reports a comment as an error and says the text is valid JSONC. The editor still opens the file and shows a note that the comments were ignored, so you can read and edit it. To get strict JSON, copy the document from the editor with Copy Formatted, or paste it into the JSON formatter. Both write strict JSON without the comments.

## Frequently asked questions

### Why does my JSON fail when it looks fine?

The usual causes are easy to miss. They are a trailing comma after the last item, a single quote where a double quote belongs, an unquoted key, and a comment. All four are legal in JavaScript and illegal in strict JSON.

### Does Fix all always work?

No. It repairs the mistakes listed above. It cannot guess a closing quote or bracket that is missing, so you fix those by hand. If the result is still not valid, the dialog shows what is left.

### Can I undo a repair?

Yes. After Fix all, the green summary line has an Undo link that puts your original text back.

### What is the difference between this page and the JSON validator?

The validator page gives a verdict, valid or not. This page is for repair: it explains each mistake and fixes the common ones. Both use the same strict check in the box.

### Why is the reported line not where I made the mistake?

A parser reports where it noticed the problem. For a missing comma, that is the next item. For a missing quote, it can be later in the text. Check the line above the position.

## Related tools

- [JSON Validator](https://prettify.tools/json-validator)
- [JSON Formatter: Prettify and Pretty Print JSON](https://prettify.tools/json-formatter)
- [JSON Viewer with Tree, Table, and Diagram Views](https://prettify.tools/json-viewer)
- [JSON Editor Online](https://prettify.tools/json-editor)
- [How to Edit a JSON File](https://prettify.tools/how-to-edit-a-json-file)
- [YAML Validator and Linter](https://prettify.tools/yaml-validator)

## Structured data

```json
{
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "name": "Prettify",
  "url": "https://prettify.tools",
  "description": "Multi-format data viewer, editor, and query engine for JSON, YAML, CSV, XML, Mermaid, Markdown, MDX, HTML, and SVG",
  "applicationCategory": "DeveloperApplication",
  "operatingSystem": "Web, macOS, Windows, Linux",
  "offers": [
    {
      "@type": "Offer",
      "price": "0",
      "priceCurrency": "USD",
      "description": "Free tier with core features"
    },
    {
      "@type": "Offer",
      "price": "19.99",
      "priceCurrency": "USD",
      "description": "Pro: lifetime access to all features"
    }
  ],
  "publisher": {
    "@id": "https://prettify.tools/#organization"
  }
}
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "@id": "https://prettify.tools/#organization",
  "name": "Prettify",
  "legalName": "Off Leash Labs",
  "url": "https://prettify.tools/",
  "logo": {
    "@type": "ImageObject",
    "url": "https://prettify.tools/icon-512.png",
    "width": 512,
    "height": 512
  },
  "contactPoint": {
    "@type": "ContactPoint",
    "contactType": "customer support",
    "email": "offleashlabs@gmail.com",
    "availableLanguage": "English"
  }
}
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "WebPage",
      "@id": "https://prettify.tools/json-syntax-checker",
      "url": "https://prettify.tools/json-syntax-checker",
      "name": "JSON Syntax Checker: Find & Fix JSON Errors Online | Prettify",
      "description": "Find JSON syntax errors by line and column, then fix the common ones: trailing commas, single quotes, unquoted keys, and missing commas. Free, with no upload.",
      "isPartOf": {
        "@type": "WebSite",
        "name": "Prettify",
        "url": "https://prettify.tools"
      }
    },
    {
      "@type": "FAQPage",
      "mainEntity": [
        {
          "@type": "Question",
          "name": "Why does my JSON fail when it looks fine?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "The usual causes are easy to miss. They are a trailing comma after the last item, a single quote where a double quote belongs, an unquoted key, and a comment. All four are legal in JavaScript and illegal in strict JSON."
          }
        },
        {
          "@type": "Question",
          "name": "Does Fix all always work?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "No. It repairs the mistakes listed above. It cannot guess a closing quote or bracket that is missing, so you fix those by hand. If the result is still not valid, the dialog shows what is left."
          }
        },
        {
          "@type": "Question",
          "name": "Can I undo a repair?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "Yes. After Fix all, the green summary line has an Undo link that puts your original text back."
          }
        },
        {
          "@type": "Question",
          "name": "What is the difference between this page and the JSON validator?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "The validator page gives a verdict, valid or not. This page is for repair: it explains each mistake and fixes the common ones. Both use the same strict check in the box."
          }
        },
        {
          "@type": "Question",
          "name": "Why is the reported line not where I made the mistake?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "A parser reports where it noticed the problem. For a missing comma, that is the next item. For a missing quote, it can be later in the text. Check the line above the position."
          }
        }
      ]
    }
  ]
}
```
