How to prettify json configuration files for readability
- Step 1Paste the unformatted configuration JSON — Copy and paste the content of the config file. It may be minified, inconsistently indented, or contain extra whitespace from programmatic edits.
- Step 2Choose the indent standard for your project — Most JavaScript projects use 2-space indent (Node.js, React, TypeScript). Java and Python projects often use 4-space indent. Match the indent to your project's .editorconfig or Prettier config.
- Step 3Review and write back to the file — Copy the prettified output and replace the file content. For IDE config files (launch.json, settings.json), ensure the file ends with a newline — most editors expect a trailing newline.
- Step 4Prevent future formatting drift with Prettier — Add Prettier to the project and configure JSON formatting: npx prettier --write '*.json'. Add this to git hooks or CI to maintain consistent formatting automatically.
Frequently asked questions
Can I prettify package.json without breaking its key order?+
Yes — disable key sorting when prettifying package.json. Some package managers and tools depend on specific key ordering in package.json (e.g. main before module, scripts before dependencies). Prettify with sorting off to normalize whitespace while preserving key order.
What happens if the JSON config has trailing commas or comments?+
Standard JSON does not support trailing commas or // comments, but tsconfig.json and VS Code config files use JSONC (JSON with Comments). This tool has a permissive mode that strips comments and trailing commas before formatting so JSONC files are handled correctly.
Are configuration files with API keys transmitted to JAD Apps?+
No. Formatting runs entirely in your browser. Configuration file content including private API keys and secrets is never transmitted to JAD Apps servers.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.