Package.json Formatter and Validator
Validate package.json syntax and catch common dependency issues. Free to use, no signup required for occasional use.
Formatted package.json will appear here…What is the Package.json Formatter/Validator?
The Package.json Formatter/Validator checks a Node.js package.json file for valid JSON syntax and common mistakes: a missing "name" or "version" field, and packages listed in both dependencies and devDependencies at once, which can cause confusing installs and version drift. It then pretty-prints the file with consistent 2-space indentation so it's easy to review or commit. This is useful when hand-editing a package.json, merging a teammate's changes, or scaffolding a new project and wanting a quick sanity check before running npm install.
How to use it
Paste your package.json content into the input box and click 'Validate & Format'. If the JSON has a syntax error, the exact parser error is shown. If it parses successfully, any warnings about missing fields or duplicate dependencies are listed, and a cleanly formatted version appears below, ready to copy back into your project.
Frequently asked questions
Does this catch every possible package.json mistake?
It checks JSON validity plus a few of the most common issues — missing name/version and dependencies duplicated in devDependencies — not the full npm schema.
Does formatting change my dependency versions?
No, formatting only re-serializes the JSON with clean indentation; the values themselves are left untouched.
Is my package.json content sent anywhere?
No, validation and formatting run entirely in your browser.
