JSON Linter Online — Catch Errors Before They Reach Your Codebase
Table of Contents
Linting JSON means checking it for errors before it reaches production. A JSON linter validates the syntax — detecting missing commas, trailing commas, unquoted keys, invalid values, and other violations that will cause parse errors in production. The WildandFree JSON Formatter lint-validates your JSON as you paste it, showing errors with exact line and column numbers.
No signup. No upload. Instant results.
JSON Linting vs JSON Validation — Is There a Difference?
In practice, people use these terms interchangeably for JSON. Strictly speaking:
Validation checks that the data conforms to a specification — in JSON's case, that it's well-formed according to the JSON RFC. It's a pass/fail check: this is valid JSON, or it isn't.
Linting traditionally checks not just correctness but also style, conventions, and potential issues — even things that are technically valid but are considered bad practice. In JSON, since the format is so rigid, "linting" usually just means validation. Unlike JavaScript, there's no concept of "valid but poorly styled" JSON — it's valid or it isn't.
When someone says "JSON linter," they generally mean a JSON validator. Both terms lead to the same tool: something that checks your JSON for syntax errors and tells you where they are.
What a JSON Linter Catches
A JSON linter finds these categories of problems:
- Trailing commas: The most common error — a comma after the last item in an object or array
- Missing commas: Forgetting the comma between two items
- Unquoted keys: Keys that aren't wrapped in double quotes
- Single-quoted strings: Using single quotes instead of double quotes
- Comments: JavaScript-style // or /* */ comments (not allowed in JSON)
- Unbalanced brackets/braces: An opening
{without a closing}, or vice versa - Invalid escape sequences: Backslash followed by a character that isn't a valid JSON escape
- Invalid values: Using
undefined,NaN, orInfinity— these are valid JavaScript but not valid JSON - Duplicate keys: Two entries with the same key in the same object (technically allowed by spec, but usually a bug)
Setting Up JSON Linting in Your Development Workflow
In VS Code: VS Code validates JSON files automatically. Open a .json file and errors appear as red underlines. The Problems panel (Ctrl+Shift+M) lists all issues. No extension needed for basic validation.
In your editor (other): Most modern editors (IntelliJ, Sublime Text, Atom, Neovim) have JSON validation either built-in or via plugins. Enable it if it isn't on by default.
Pre-commit hook: Add JSON validation to your pre-commit hooks using the check-json hook from the pre-commit library, or a custom hook that runs python3 -m json.tool on all changed .json files. Errors block the commit.
CI/CD: Include a JSON validation step in your CI pipeline. Any malformed JSON in the repo fails the build before deployment.
For one-off checks: Use the online linter. Paste the JSON, see results immediately. Faster than setting up tooling for files you edit occasionally.
JSON Linting for Config Files — Where Errors Hurt the Most
Config files in JSON format (package.json, tsconfig.json, .eslintrc.json, launch.json, settings.json) deserve special attention because errors in them cause hard failures:
- A bad
package.jsonbreaksnpm installfor everyone on the team - A bad
tsconfig.jsonprevents TypeScript compilation - A bad
.eslintrc.jsondisables linting silently or crashes the linter
Config files are also the most hand-edited JSON in a typical project — they're not machine-generated, so human error is common. Before committing a change to any config file, paste it into the linter. It takes 10 seconds and prevents a broken build that affects the whole team.
One specific pattern to watch: adding a new key to a JSON object and forgetting to add a comma after the previous last key. This is the #1 config file JSON error.
Try It Free — No Signup Required
Runs 100% in your browser. No data is collected, stored, or sent anywhere.
Open Free JSON FormatterFrequently Asked Questions
How do I lint JSON files in VS Code?
VS Code lints JSON files automatically — no extension required. Errors appear as red squiggles and in the Problems panel. Make sure the file has a .json extension so VS Code knows to apply JSON validation rules.
Is there a JSON linter for the command line?
Yes. python3 -m json.tool filename.json validates JSON and exits with a non-zero code if invalid. jq . filename.json does the same. The npm package jsonlint-cli provides the same behavior. All three work in CI/CD pipelines.
Can I lint JSONC files (JSON with comments)?
Standard JSON linters reject comments as invalid. For JSONC (JSON with Comments), used in tsconfig.json and VS Code settings, use a JSONC-aware parser. VS Code handles JSONC automatically for known file types. Online JSON validators will flag comments as errors.

