Understanding Text and JSON Diffing
A "diff" is the identified set of differences between two versions of a document, dataset, or text block. Comparing content side-by-side allows you to pinpoint exactly what has been added, removed, or modified between an original state and a modified state. This process is critical when tracking changes in configuration files, reviewing API responses, verifying data before and after a migration, or reviewing edits in short texts.
When comparing data, the method of comparison must match the structure of the input. Raw text requires a sequential analysis of characters, words, or lines. Structured data, such as JSON (JavaScript Object Notation), requires a semantic analysis that understands objects, arrays, and key-value pairs rather than just the literal text formatting.
Text Comparison and Granularity
In Text mode, the comparison engine analyzes raw content sequentially. You can configure the comparison using two levels of granularity:
- Lines: The tool compares the inputs line-by-line. This is highly effective for code, structured lists, or prose where changes are organized by line breaks.
- Words: The tool compares the inputs word-by-word. This provides a more precise view of small edits, such as a single word replacement within a long sentence.
To demonstrate how text differences are highlighted, consider the following sample inputs:
- Original:
BroBroGo tools run in your browser. They are fast, private and simple. Use them when you need a quick check. - Modified:
BroBroGo tools run in your browser. They are fast, private and focused. Use them when you need a quick comparison.
Comparing these two samples reveals specific modifications: the word "simple" is replaced by "focused" on the second line, and the word "check" is replaced by "comparison" on the third line.
JSON Data Structure Comparison
Comparing JSON as raw text often leads to false positives because formatting differences—such as extra spaces, newlines, or a different ordering of object keys—do not change the actual meaning of the data.
In JSON mode, the tool parses both inputs into structured data before performing the comparison. This introduces specific rules for identifying changes:
- Object Keys: Keys within a JSON object are compared by name. Because of this, changes in key order alone are not reported as semantic changes.
- Arrays: Arrays are ordered lists, so they are compared by position (index).
- Structural Paths: Changes are listed by their exact structural paths (for example, identifying a change at a specific nested path).
Consider the following JSON sample inputs:
- Original JSON:
{ "name": "BroBroGo", "plan": "free", "tools": ["json", "regex", "hash"], "private": true } - Modified JSON:
{ "name": "BroBroGo", "plan": "free", "tools": ["json", "regex", "diff"], "private": true, "updated": 2026 }
When compared in JSON mode, the tool identifies two specific changes:
- An addition: The key
"updated"with the value2026is added. - A modification inside an array: In the
"tools"array, the item at index 2 is changed from"hash"to"diff".
If the inputs are valid JSON but contain identical values, the tool displays "No JSON value changes found".
Input Limits and Performance Rules
To maintain a responsive interface, the tool enforces specific limits and safety rules during processing:
- Character Limits: Each individual input side ("Original" and "Modified") is capped at a maximum of 300,000 characters.
- Size Capping: If an input exceeds the allowed size, the tool stops and displays the error: "That input is too large for this tool. Try a smaller comparison".
- Timeout Protection: Complex comparisons can be computationally expensive. If a comparison takes longer than 2.5 seconds, the operation is terminated, and the tool displays: "This comparison is taking too long. Try smaller input or line mode".
- Capped Results: In some cases, the tool may display a partial result to prevent the browser tab from freezing, accompanied by the message: "Showing a capped result so the page stays responsive".
- Invalid JSON Handling: If the input cannot be parsed in JSON mode, the tool displays "Left JSON is invalid:" or "Right JSON is invalid:" followed by the specific parser error.
- General Failures: If an unexpected error occurs during the diffing process, the tool displays: "Could not compare these inputs".
Client-Side Processing and Privacy
When working with configuration files, API payloads, or proprietary text, data privacy is a primary concern.
This tool performs all comparisons directly in your browser. Your text and JSON inputs are processed locally on your device; nothing is uploaded to BroBroGo. This client-side execution ensures that your data remains within your local browser environment throughout the entire comparison process.
Interface Reference and Actions
The tool interface provides several controls and status indicators to manage your comparison workflow:
| Control / Label | Description / Action |
|---|---|
| Original | The input field for your base text or JSON. |
| Modified | The input field for the changed text or JSON. |
| Swap | Swaps the content of the left and right inputs, displaying "Left and right swapped". |
| Clear | Clears both input fields, displaying "Both sides cleared". |
| Differences | The output section listing the detected changes. |
| Added | Label indicating content present only in the modified version. |
| Removed | Label indicating content present only in the original version. |
| Changed | Label indicating content that has been modified between versions. |
Frequently Asked Questions
What is the difference between text and JSON mode?
Text mode compares the raw content by line or word. JSON mode parses both sides first, formats them consistently and lists changed paths such as $.user.email.
Can it handle very large input?
Slow comparisons stop after 2.5 seconds. Very large accidental pastes are capped so the page stays responsive.
Does JSON mode ignore object key order?
The structured change list compares object keys by name, so key order alone is not reported as a semantic change. Arrays are compared by position.