Diff JSON Config Files Between Environments

Last updated: February 22, 2026

Configuration drift between environments is one of the most common sources of production bugs. A feature flag set differently in staging, a timeout value that was changed in production but not backported to dev, a new config key added to one environment but not others. When configs are in JSON format (as they are in most modern applications), you need a structural comparison tool that catches every difference.

The Problem

JSON config files across environments often have hundreds of keys spread across nested objects. Manually comparing them is tedious and unreliable. Standard text diff tools generate noisy output because config files are frequently reformatted or keys are reordered between environments. A true structural diff ignores formatting and key ordering to show only the real configuration differences.

How It Works

1

Export config files

Get the JSON config files from both environments. This might be from a config management system, a deployment tool, a .env.json file, or an API endpoint that serves configuration.

2

Open JSON Diff and upload

Go to JSON Diff on OneClickPDF. Upload or paste both config files — left panel for the source environment, right panel for the target.

3

Compare and filter

Click Compare to generate the diff. Enable 'Only changes' to hide all identical config values and focus on the differences. The diff tree shows exactly which keys are added, removed, or have different values.

4

Copy paths and fix drift

Click on any changed config key to copy its full JSON path. Use this path to locate and fix the drift in your deployment scripts, config management tool, or directly in the environment.

JSON Diff

Compare two JSON files side by side and see every difference highlighted.

Try It Free

JSON Beautifier

Format, validate, and beautify JSON with syntax highlighting.

Try It Free

Frequently Asked Questions

Can I compare configs with different key ordering?
Yes. The diff is structural — key ordering doesn't matter. {"timeout":30,"retries":3} and {"retries":3,"timeout":30} are correctly identified as identical.
My config has environment-specific keys that should differ. Can I ignore them?
Currently the tool compares everything. You can visually skip expected differences in the tree, or pre-process your configs to remove known environment-specific keys before comparing.
Can I compare YAML configs?
Not directly, but you can convert YAML to JSON first using any online converter, then paste the JSON into the diff tool.
Is it safe for configs with database passwords and API keys?
Yes. Nothing is uploaded to any server. The comparison runs entirely in your browser's JavaScript engine. Your config data never leaves your device.

Config drift causes subtle, hard-to-diagnose bugs that waste hours of debugging time. OneClickPDF's JSON Diff catches every difference in seconds — with JSON path copying so you know exactly where to fix it. All processing stays in your browser, safe for configs with secrets and credentials.

Related Guides