composer.json / package.json Validator.
Lint package.json and composer.json — names, versions, dependency ranges, autoload and common mistakes.
Runs in your browserAbout composer.json / package.json Validator
This validator checks the two dependency manifests most web projects carry: package.json for npm, pnpm, Yarn and Bun, and composer.json for PHP. Paste the file and it detects the format, parses it with line and column errors, and lists every problem with its path and a severity. Errors are things the package manager rejects or misreads: a package name with capital letters or spaces, a version that is not semantic versioning, a "type" other than module or commonjs, a dependency range such as ^1.2.3.4 that cannot be parsed, a script that is a number instead of a string, or a PSR-4 namespace like Acme\Billing without the trailing backslash, which makes Composer silently fail to autoload your classes. Warnings are legal but risky: unbound constraints such as >=7.0 or * that will pull in the next breaking major release, exact pins that block bug fixes, the same package in both runtime and dev dependencies, a missing license, or a hard-coded "version" in composer.json, which Composer recommends leaving to VCS tags. Version ranges are parsed with real npm and Composer rules, so ~1.2 is understood differently in each, exactly as the two package managers do. The checks follow the npm package.json documentation and the Composer schema; they do not contact the registry, so they cannot tell you whether a package or version actually exists. Use it before publishing, when reviewing a pull request that touches dependencies, or when a CI step fails with a cryptic manifest error. Everything runs in your browser.
How to Use
- Paste the contents of package.json or composer.json.
- Leave the file type on auto or choose it explicitly.
- Fix the errors first, then review the warnings.
Frequently Asked Questions
Does it check that dependencies exist on npm or Packagist?
No. It checks syntax and rules offline. Whether a package or version exists can only be answered by the registry, for example with npm view or composer show.
Why is ">=7.0" only a warning?
It is valid, but it has no upper bound, so a future major version with breaking changes would be installed automatically. A caret range such as ^7.0 is usually what you want.
How is the file type detected?
Files with require, autoload or minimum-stability keys, or a vendor/package name without @, are treated as composer.json; everything else as package.json. You can override it.
Is my file uploaded?
No. Validation runs in your browser and the page makes no network requests while you use it.
Related Tools
Test which versions satisfy an npm or Composer range such as ^1.2.3, ~2.0 or >=7.4 <9.
Pretty print, minify, and validate JSON.
Fix broken JSON — trailing commas, single quotes, comments, missing brackets — and see every repair made.
Compare two JSON documents and see every added, removed and changed value by path.
Convert between YAML and JSON formats.
Test regular expressions with match highlighting.