{ Package.json Validator }

// validate package.json syntax instantly

Validate package.json syntax instantly in the browser. Check required fields, semver versions, scripts, dependencies, and common mistakes. Free, no sign-up.

Paste the full contents of your package.json file
📦

Paste your package.json

Click Validate to check for errors

HOW TO USE

  1. 01
    Paste your file

    Copy the full contents of your package.json and paste it into the editor on the left.

  2. 02
    Click Validate

    The tool checks JSON syntax, required fields, semver versions, and common npm mistakes.

  3. 03
    Review results

    Errors and warnings appear with clear descriptions. Fix issues and re-validate until everything is green.

WHAT WE CHECK

JSON Syntax Required Fields Semver Format Dependencies Scripts Field Types

COMMON ISSUES CAUGHT

  • 🔴 Invalid JSON syntax (missing comma, brace)
  • 🟡 Missing name or version field
  • 🟡 Invalid semver string (e.g. v1.0)
  • 🔵 Wrong type for dependencies object
  • 🔵 Numeric version ranges instead of strings
  • 🟢 Empty scripts or dependency objects

WHAT IS THIS?

The Package.json Validator checks your npm package manifest for JSON syntax errors and semantic issues. It goes beyond basic JSON parsing to verify field types, semver version formats, and npm-specific conventions — all client-side with no file upload needed.

RELATED TOOLS

FREQUENTLY ASKED QUESTIONS

What fields does the validator check?

It checks JSON syntax first, then verifies required fields (name, version), semver format on version, that dependencies, devDependencies, peerDependencies, and scripts are plain objects, and that common string fields like description, license, and main are actually strings.

Does it upload my package.json anywhere?

No. All validation runs entirely in your browser using JavaScript. Your file contents never leave your device and are never sent to any server.

What semver formats are considered valid?

The validator accepts standard semver strings like 1.0.0, 2.3.1-beta.1, and 0.0.1-alpha+build.123. It flags strings with a leading v (e.g. v1.0.0) and non-numeric or missing segments.

Can it validate private or scoped packages?

Yes. Scoped package names like @myorg/my-package are recognized as valid. The "private": true field is also detected and noted in the fields overview.

What's the difference between errors and warnings?

Errors (🔴) are issues that will likely cause npm to reject or misread your package — invalid JSON or a missing name field, for example. Warnings (🟡) are best-practice violations or suspicious values that may cause problems but won't necessarily break anything immediately.

Can I use this to validate monorepo workspace package.json files?

Yes. Paste any individual package.json — root workspace manifest or sub-package — and the validator will check it. Note that workspace-specific fields like workspaces are recognized and listed in the fields overview.

Package.json Validator — Check Your npm Manifest Instantly

Every Node.js project and npm package relies on a package.json file as its manifest. A single typo, a missing comma, or an invalid version string can cause npm install to fail, break CI pipelines, or prevent a package from publishing. Our free browser-based Package.json Validator catches these issues in seconds — no install, no sign-up, no upload required.

What Is package.json?

The package.json file is the heart of any Node.js project. It defines the package name, version, description, author, license, entry points, scripts, and dependency lists. When you run npm install, npm publish, or any npm lifecycle command, npm reads this file first. If it's invalid JSON or missing required fields, the command will fail immediately with a cryptic error message.

Why Validate package.json?

JSON syntax errors are the most obvious problem — a trailing comma, an unmatched brace, or an unescaped character will break parsing entirely. But beyond syntax, there are dozens of semantic rules: the version field must follow Semantic Versioning (semver), the dependencies field must be a plain object (not an array), and fields like main and description must be strings. Our validator checks all of these automatically.

Validation Rules Explained

Understanding Semver in package.json

The version field of a package must use strict semver: MAJOR.MINOR.PATCH. For example, 1.0.0, 2.3.1, or 0.0.1-alpha.1 are all valid. A leading v like v1.0.0 is technically not valid semver for the version field (although it is valid in version ranges inside dependencies). Our validator flags these edge cases so you can fix them before publishing.

Common Mistakes in package.json

Even experienced developers make mistakes in package.json. Some of the most common include: adding a trailing comma after the last field (not valid in JSON), using single quotes instead of double quotes, forgetting to quote version range strings inside dependencies, setting dependencies to an array instead of an object, or using a version string like latest directly in the version field rather than in a dependency range.

Format JSON After Validating

Once your file passes validation, you can click "Format JSON" to reformat it with consistent 2-space indentation. This is useful if you've manually edited your package.json and want to restore clean formatting before committing it to version control.

Browser-Based, Private, and Fast

The entire validation engine runs in JavaScript inside your browser tab. There is no server involved, no API call, and no data retention. You can use this tool on sensitive internal packages without any privacy concern. It works on all modern browsers and mobile devices with no installation.