Code Diff (Line Compare)
Compare two versions of code or text line by line. Paste the original, a line containing only ===, then the new version.
About this tool
Compare two versions of code or text line by line. Paste the original, a line containing only ===, then the new version.
Example
Input: old\n===\nnew
Output: - old\n+ new
Privacy
This tool runs entirely in your browser. Your data is processed locally and never uploaded to a server.
How to use this tool
- Paste the original version of your code or text into the top area.
- Add a line that contains only === to separate the two versions.
- Paste the new version below that separator.
- Run the diff to see which lines were added, removed, or changed.
Step by step, what happens
- The tool reads your input as two blocks separated by a line with only ===.
- It compares the blocks line by line instead of trying to understand the code structure.
- It marks lines that exist only in the first block as removed and lines only in the second block as added.
- When a line changed, it shows the difference so you can quickly spot what was edited.
Worked example
Here is a small text change where one line is updated and one line is added.
Input: const name = 'Ava';
console.log(name);
===
const name = 'Ava';
console.log('Hello, ' + name);
- The tool splits the input at the === line into an original block and a new block.
- It compares the two console.log lines and sees that one was changed, not just copied.
- It keeps the unchanged name declaration as matching content and highlights the updated output line.
Output: Removed:
console.log(name);
Added:
console.log('Hello, ' + name);
Tips and common mistakes
- Use a separator line with only ===. If you add extra spaces or text on that line, the tool may not split the blocks correctly.
- Keep indentation and blank lines if they matter, because the diff compares text line by line.
- If a whole block looks changed, check for small formatting edits like spaces, quotes, or line breaks.
- For the clearest result, compare one focused change at a time instead of pasting two unrelated files.
Frequently asked questions
How do I enter two versions?
Paste the original, a line with only ===, then the new version.
What do the symbols mean?
Lines starting with - were removed, + were added, and two spaces means unchanged.
Is it a full diff?
It is a line-by-line comparison; it does not align moved blocks like a full diff algorithm.
More Developer Tools Tools
Explore related calculators in this category
Code Beautifier
Beautify and indent JSON or CSS code automatically. Clean up minified or messy code.
Code Minifier
Minify JSON or CSS code by removing whitespace and comments. Auto-detects the language.
JSON Diff
Compare two JSON objects and see which keys were added, removed or changed.
.htaccess Generator
Generate common .htaccess rules, force HTTPS, www redirect, and caching, with checkboxes.
You Might Also Like
Popular tools from other categories
Capacitor Code Calculator
Decode a 3-digit ceramic capacitor code to capacitance.
Resistor Color Code Calculator
Calculate resistance from color bands.
Wire Ampacity Reference
Look up the typical ampacity of common copper wire sizes.
1031 Exchange Calculator - Free Online
Free Calculate tax deferral in a 1031 exchange. Step-by-step solutions and formulas included. Fast, accurate, and free, with formula and example.
Can't Find the Right Calculator?
Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.