JSON Mirror
How to review padded string values in JSON Mirror
Compare your Before and After JSON with Trim string edges off, then enable it and compare again. The second pass ignores leading and trailing whitespace in string values without changing your inputs. Case, internal spacing, key and type changes still count. The report records the selected rule and only the differences found under it.
Start with an exact comparison
Use this workflow when two documents mix padded text with edits you need to review. Paste {"name":" Mira ","city":"New York","role":"editor"} into Before and {"name":"Mira","city":"New York","role":"Editor"} into After. The second city contains two spaces between its words.
Leave Trim string edges unchecked and select Compare JSON. You can also press Ctrl plus Enter or Command plus Enter in either editor. This pair produces three Changed entries: /name, /city and /role. Read the values beside each path before deciding which differences your review can ignore.
Indentation outside strings does not need the trim option: the tool compares parsed values. Spaces inside quoted text are part of the value and are compared exactly with the option off. Keep your source documents outside the tab so you can return to them later.
Run the second pass without rewriting the sources
Enable Trim string edges. Changing this rule marks the current result stale and disables Export report; select Compare JSON again. The checkbox alone does not run another comparison.
For this example, /name disappears because both strings become "Mira" for the equality check. The /city and /role entries remain, leaving two Changed entries. Internal spaces and letter case still matter. The option applies throughout the compared structure, including strings inside arrays; there is no per-field trim setting.
Trimming does not remove spaces from either editor. If you need corrected source data, edit your own document deliberately. A quieter result tells you which differences the rule suppressed, not whether padding is acceptable to the system consuming the JSON.
Check keys and types separately
The rule does not trim object keys. Before {"name ":"Mira"} and After {"name":"Mira"} still produce a Removed entry for the old key and an Added entry for the new one. Correcting a padded field name changes the structure even when its value stays identical.
Types also remain distinct. Before {"count":" 7 "} and After {"count":7} produce one Changed entry with trimming enabled: a string has become a number. The option does not convert numeric text or treat a missing member as an empty string.
Inspect a branch and save the chosen interpretation
After comparing, use Filter by path to narrow the log. Entering /city finds paths containing that text; it does not search values. Category buttons can narrow the result further. Path filtering is case-insensitive, while string-value comparison remains case-sensitive.
Export report saves a JSON file which includes trimStringEdges. Recorded changes retain the original parsed values, including outer whitespace on values that still differ. They are not rewritten as trimmed strings.
The download includes all recorded changes regardless of visible filters, but it cannot restore a difference suppressed by trimming. Save the exact pass before enabling the option if you need both interpretations. Both downloads request the filename json-mirror-report.json; distinguish the saved files yourself.
Finish with the limits and session in mind
Turn trimming off and compare again whenever exact text becomes the review question. Editing either source also invalidates results, so finish both edits before comparing. A successful comparison supports 1,000,000 characters per side and traversal up to 120 nesting levels. Exceeding limits fails rather than producing a partial report; compare corresponding smaller sections if necessary.
Working content stays in tab memory with no saved history. Download anything you need before reloading or closing the tab. Clear removes inputs and results and resets filters and trimming. A report contains differences under its rules, not complete copies of both source documents.
AI-assisted ForgeHub editorial. App capabilities were checked against its implementation; this guide is not an independent review.
Frequently asked questions
Does Trim string edges ignore tabs and line breaks?
It uses JavaScript string trim(), so leading and trailing whitespace such as parsed tabs and line breaks is ignored when both values are strings. Internal whitespace still counts. Tabs and line breaks inside JSON strings must use valid JSON escapes.
Can I enable trimming for just one field?
No. The checkbox supplies one rule for the entire comparison. To examine one field separately, manually compare corresponding smaller values. Filtering paths only selects existing results; it does not change the rule.
Why is a padded value absent from the second report?
Strings differing only at their edges generate no change entry when trimming is enabled. Downloading includes all recorded changes but cannot restore ignored differences. Save the exact pass separately if you need those entries.
Does No differences mean the JSON texts are identical?
No. Their parsed values match under the selected rules. Key order and formatting are ignored, and enabled trimming also ignores outer string whitespace. JavaScript parsing semantics apply, including last-value handling of duplicate keys and number precision limits.