🌙 Night Mode
Home β€Ί JSONLint
πŸ” Free Tool

JSON Lint

The classic JSON Linter. Instantly check your syntax, uncover hidden errors, and format invalid JSON to valid structures.

Input JSON
Characters0
Lines0
πŸ”
Waiting for input…
Paste JSON on the left to begin linting
⚑
Real-time Linting
Instantly evaluate JSON code using the world's most popular JSON processing rules.
🎯
Detailed Output
ASCII error pointers reveal exactly what went wrong and where.
πŸ› 
Fix Missing Quotes
Sometimes your JSON isn't quite valid. Auto-fix makes it perfect.

What Is JSONLint? A Complete Guide to Online JSON Linting

JSONLint is the original, battle-tested open-source linter for JavaScript Object Notation (JSON). Since its inception, it has become the go-to syntax checker for developers, DevOps engineers, and data analysts who need to verify the integrity of JSON data quickly. Unlike a basic JSON validator that returns a binary pass/fail result, JSONLint performs a deep, character-level trace and pinpoints the exact location of any syntax error β€” making it an indispensable part of any developer's debugging toolkit.

What Does a JSON Linter Actually Do?

A JSON linter parses your JSON text using a formal grammar parser and compares it against the strict RFC 8259 (JSON) specification. Every structural rule is checked:

  • Key quoting: JSON requires all keys to be double-quoted strings. Bare identifiers like name: instead of "name": will cause a parse error.
  • Trailing commas: Unlike JavaScript objects, JSON does not allow trailing commas after the last array item or object property. JSONLint will flag every instance.
  • Missing commas: Forgetting a comma between two properties in an object or two items in an array is one of the most common hand-editing mistakes β€” JSONLint catches it immediately.
  • Wrong quote style: JSON demands double quotes only. Single-quoted strings like 'hello' are not valid and will trigger a lint error.
  • Invalid escape sequences: Backslash escapes like \n, \t, or \" are legal, but malformed ones like \q are not.
  • Unclosed brackets/braces: An object { or array [ that is never closed will be detected with a pointer to where the parser lost track.
  • Invalid literals: JSON only recognises true, false, and null. Variants like True, FALSE, or undefined are invalid.

JSONLint vs JSON Validator β€” What's the Difference?

Many people use the terms "linter" and "validator" interchangeably, but there is a meaningful difference in the depth of feedback each provides.

A JSON Validator answers the question: "Is this JSON?" It parses the document and returns either valid or invalid. Most modern browsers can do this in a single line of JavaScript using JSON.parse(). The error messages from a bare validator are often terse and developer-unfriendly β€” something like "Unexpected token at position 47."

A JSON Linter, by contrast, answers: "Is this JSON, and if not, exactly where and why is it broken?" JSONLint uses a purpose-built grammar (based on Douglas Crockford's original implementation) that produces contextual, human-readable error messages with ASCII arrow pointers (^) highlighting the exact character that caused the failure. This level of detail can turn a 30-minute debugging session into a 30-second fix.

Common JSON Errors JSONLint Catches

Here are the most frequent JSON mistakes that developers encounter in the wild, all of which JSONLint identifies precisely:

  1. Trailing comma in an object: {"a":1,"b":2,} β€” the comma after 2 is illegal.
  2. Unquoted property key: {name:"Alice"} β€” name must be "name".
  3. Single-quoted value: {"city":'London'} β€” must use double quotes.
  4. Comments inside JSON: // this is a note β€” JSON does not support comments of any kind.
  5. JavaScript values: Using undefined or NaN as a value β€” neither is a valid JSON primitive.
  6. Missing closing brace: A JSON fragment copied out of the middle of a larger document often lacks its outer wrapper.

How to Use This JSONLint Tool

  1. Paste your raw JSON into the Input JSON panel on the left.
  2. Click Lint JSON or wait for real-time validation to kick in automatically.
  3. If valid, you will see a green βœ… confirmation. If invalid, a red error box will appear with the linter's full trace message pinpointing the problem.
  4. Use the Auto-fix & Format button to repair common issues like unquoted keys or single-quoted strings, and to pretty-print the result with 2-space indentation.
  5. Use the Valid Sample and Invalid Sample buttons to explore how the linter behaves before using your own data.

When Should You Lint Your JSON?

JSONLint is most valuable in the following situations: debugging a failing API response, hand-editing a configuration file (like package.json or tsconfig.json), transforming data from another format into JSON, or investigating a webhook payload that is causing unexpected behaviour in your application. Running your JSON through a linter before processing it programmatically is a simple habit that saves hours of downstream debugging.

All linting runs entirely in your browser β€” no data is sent to any server, making it safe to use with sensitive API responses or internal configuration files.