Diff checker · Compare text & code
Compare two texts or code files online
Paste the original on the left and the changed version on the right. Differing lines are marked green in the original and red in the changed version, and the exact characters that changed are highlighted — for code in any language, JSON, XML, logs, or plain text. Nothing leaves your browser.
🔒 100% private — both texts stay in your browser. Nothing is uploaded, logged, or stored.
How to compare two files
- Put the older version on the left and the newer one on the right — paste, type, or use Open file above each panel. The comparison runs as soon as both sides have text.
- Read the summary in the status bar: how many separate differences there are and how many lines were removed and added.
- Step through the changes with ↓ Next and ↑ Previous. Click into a panel first to choose which side the cursor follows.
- Hide what did not change on long files: Hide unchanged folds identical stretches down to three lines of context around each change. Click a folded marker to open it again.
- Got the sides the wrong way round? ⇄ Swap exchanges them, which turns every “removed” into “added” and vice versa.
Reading the result
| What you see | What it means |
|---|---|
| Green background on the left | The line exists only in the original — it was removed, or replaced by what is red on the right. |
| Red background on the right | The line exists only in the changed version — it was added, or is the replacement for the green line opposite. |
| Darker highlight inside a line | The exact characters that differ. A line where only a number changed shows just that number marked, so you do not have to compare the line letter by letter. |
| Hatched blank area | Space held open opposite an insertion or deletion, so the lines that did stay the same remain side by side. |
| Coloured bar next to the line numbers | A quick marker for scrolling: every line that is part of a change carries one. |
How the comparison works
The tool first finds the longest run of lines the two texts have in common, in order, and treats everything outside that common sequence as changed. It then looks inside each changed group of lines and finds the individual characters that differ, so a one-character edit in a long line is marked precisely instead of flagging the whole line. This is the same family of algorithm behind git diff and code-review tools, running in the editor that powers the rest of Indentio.
Two consequences are worth knowing. First, a diff is a shortest description of the change, not the only one: when a line could have been matched in two places, the tool picks one, and that choice occasionally looks different from how you remember making the edit. Second, moving a block counts as deleting it in one place and inserting it in another. The content is unchanged — only its position — and both copies are highlighted so you can confirm that at a glance.
Comparing JSON
Two JSON documents that mean the same thing can look completely different as text: one is minified onto a single line, the other is indented with four spaces, a third with tabs. A text diff of those marks every line. Press Format both and each side is re-indented identically, so what remains highlighted is a real change in the data — even if one of the documents has a syntax error, since the formatter lays out broken JSON as well.
Formatting only touches whitespace. Number spellings are kept exactly as written, so1.0 and 1 still show as different (some systems treat them differently), and an ID like 12345678901234567890 is never rounded the way a JavaScript round-trip would round it. Key order is compared as written too:{"a": 1, "b": 2} and {"b": 2, "a": 1} are equal as data but differ as text. If you only care about values, sort the keys in both documents the same way before comparing. Array order always matters — [1, 2] and[2, 1] are different values.
Comparing XML
The same Format both step removes indentation noise from XML. A few differences survive formatting because they are differences in the text, even where an XML parser would consider the documents equivalent:
- Attribute order —
<a x="1" y="2">and<a y="2" x="1">are the same element, but not the same line. - Empty elements —
<note/>and<note></note>are equivalent markup written two ways. - Namespace prefixes —
soap:Bodyands:Bodycan refer to the same namespace if both prefixes are bound to the same URI. - Escaping versus CDATA —
<b>and<![CDATA[<b>]]>carry identical text.
Whitespace inside text content is significant in XML, so it is never reformatted away: if one side says <name> Ada</name>, that leading space is a real difference and stays highlighted.
Comparing log files
Comparing the log of a good run with the log of a failing one is one of the fastest ways to find where behaviour diverged — except that every line starts with a timestamp, so every line differs. Remove timestamps strips dates and times from both sides (ISO 8601, syslog, Apache, Log4j, Python logging, and the other common formats), after which the lines that still differ are the ones that matter. Thread names, request IDs, and process numbers also vary between runs; when they get in the way, delete those columns on both sides before comparing. Each panel keeps its own undo history, so Ctrl+Z brings the original text back.
If what you have is a log with JSON or XML payloads in it and you need the payload itself, paste it into the JSON formatter orXML formatter and press Auto-fix: it removes the timestamps and log prefixes and rebuilds the document.
What counts as a difference
| Change | Highlighted? | Notes |
|---|---|---|
| Indentation, tabs vs spaces | Yes | Use Format both for JSON and XML. |
| Trailing spaces at the end of a line | Yes | Invisible but real — the marked characters are the spaces. |
| Letter case | Yes | Name and name are different keys, tags, and identifiers. |
| Windows vs Unix line endings | No | CRLF and LF are normalised, so a file saved on Windows matches the same file saved on macOS or Linux. |
| A missing newline at the end of the file | Yes | Shows as one empty line added or removed at the end. |
| A block moved to another place | Yes | Shown as removed in one place and added in another. |
Private by design
The texts people compare are often the sensitive ones — two versions of a production config, an API response before and after a deploy, a contract clause. Indentio computes the diff in your browser: there is no server step, nothing is sent with the page, and nothing remains after you close the tab. That also means the tool keeps working offline once the page has loaded. See the privacy policy for the details.
More tools
Frequently asked questions
Which languages can I compare?
Any text at all. The comparison works line by line and character by character, so Java, Python, C#, SQL, YAML, CSV, HTML, Markdown, configuration files, and logs all compare the same way. JSON and XML additionally get syntax colouring and the Format both button.
Is my text uploaded anywhere?
No. Both panels live in your browser tab and the diff is computed by JavaScript on your machine. Open file reads the file locally with the browser’s file API — there is no upload, and nothing is stored once you close the tab.
Can I edit the text after comparing?
Yes. Both sides are ordinary editors and the highlighting updates as you type, which makes the tool useful for working towards a match — fix a line on one side and watch its green or red marker disappear. Each panel has its own undo history (Ctrl+Z / ⌘Z).
Why does a block I only moved show as removed and added?
A line diff describes how to turn the left text into the right one using deletions and insertions. A block that changed position is, in those terms, deleted in one place and inserted in another, so it shows green on the left and red on the right. The content is identical — compare the two highlighted blocks to confirm it.
How big can the texts be?
There is no fixed limit; tens of thousands of lines work comfortably. When two large texts are very different, the detailed comparison stops after two seconds and the rest is matched with a faster method, and the status bar says the result is approximate — every difference is still shown, the diff is just not the smallest possible one.
Does it ignore whitespace or key order?
It compares exactly what is there, because whitespace and order can matter (Python indentation, YAML, XML text content). For JSON and XML, press Format both first: both sides get identical indentation, so only real changes remain. Key order is still compared as written.