sodcalculator

10 Tech How-To

Compare Two HTML Proposals & Spot Changed Terms

Guide 10-46314 · Updated · Step by step

This guide walks you through comparing two versions of an HTML proposal so you can quickly spot changed terms, clauses, or numbers. You will learn a reliable method using free tools already on your computer, plus techniques for reading the differences once you have them. No special software is required beyond a text editor and a web browser.

What You’ll Need

  • Both versions of the HTML proposal saved as files (e.g., proposal_v1.html and proposal_v2.html).
  • A plain text editor (Notepad on Windows, TextEdit on Mac, or any code editor).
  • A web browser (Chrome, Firefox, Edge, or Safari).
  • Optional: a free online diff tool or a command-line tool like diff (macOS/Linux) or fc (Windows).

Step-by-Step

  1. Make backup copies. Before doing anything, copy both HTML files to a separate folder. This ensures you can always revert if you accidentally edit the originals.
  2. Open both files in your browser. Double-click each file so they open in separate browser tabs. Quickly scan the rendered pages to get a general sense of what changed visually. Look for different headings, reordered sections, or obvious text swaps.
  3. Open both files in your text editor. Use the editor to view the raw HTML. If the files are large, turn on word wrap so lines don’t run off the screen.
  4. Use a diff tool for a line-by-line comparison. This is the core step. Choose one of these methods:
    • Online diff tool: Go to a reputable site like diffchecker.com or mergebot.com. Paste the entire content of each file into the two boxes and click “Find Difference.” The tool will highlight added lines in green and removed lines in red.
    • Command line (macOS/Linux): Open Terminal, navigate to the folder with your files (e.g., cd ~/Documents/proposals), and run diff -u proposal_v1.html proposal_v2.html. The output shows lines prefixed with - (removed) and + (added).
    • Command line (Windows): Open Command Prompt, navigate to the folder (cd C:\Users\YourName\Documents), and run fc /n proposal_v1.html proposal_v2.html. This shows line numbers for each difference.
  5. Filter out pure HTML formatting changes. Diff tools will flag every tag change, even harmless ones like a class name. Focus on the text content between tags. Look for lines that contain actual words, numbers, or punctuation. Ignore lines that only contain tags like <div>, <span>, or <p> unless the tag itself changed in a meaningful way (e.g., a heading became a paragraph).
  6. Read the diff output carefully. For each changed block, ask yourself: did a number change? Did a date change? Did a clause get added or removed? Did a party’s name change? Write down each substantive change in a separate notes file. Do not rely on memory.
  7. Search for specific terms. If you are looking for a particular term (e.g., “payment due date”), use your editor’s search function (Ctrl+F or Cmd+F) in both files and compare the surrounding context. This is faster than reading the whole diff when you know what to look for.
  8. Verify the rendered page. After you have a list of changes, go back to the browser tabs and manually check each changed area in the rendered HTML. Sometimes the raw diff shows a change that is not visible because of CSS, or vice versa. Confirm that what you found in the code matches what a reader would see.
  9. Document your findings. Create a summary table with columns: Section, Old Text, New Text, and Impact. This makes it easy to share the results with colleagues or clients.

Common Mistakes

  • Comparing rendered pages side-by-side without a diff tool. Your eyes will miss small changes in a long document. Always use a text-based diff.
  • Ignoring whitespace changes. Extra spaces or line breaks can cause false positives in the diff. Use a tool that ignores whitespace (most online tools have this option) or mentally filter them out.
  • Assuming all tag changes are harmless. A change from <h2> to <h3> might indicate a section was demoted, which could change the legal hierarchy of clauses.
  • Only looking at the first difference. Diff tools often show hundreds of changes. Work through the entire list systematically.
  • Forgetting to check embedded content. If the HTML contains images, tables, or iframes, the diff may not show changes inside those. Open each embedded resource separately if needed.

Tips

  • Normalize the files first. If the two versions were created by different tools (e.g., Word vs. Google Docs), the HTML may have completely different formatting. Run both through an HTML formatter (like the one at freeformatter.com) before diffing to reduce noise.
  • Use a diff tool that supports “ignore whitespace” and “ignore case.” This cuts down on false positives dramatically.
  • For very large files, diff in sections. Copy the <body> content only, or split the file into chapters, and diff each part separately.
  • Keep a version history. Going forward, use a version control system like Git. Even a simple folder with dated copies is better than nothing.
  • Check the <head> section too. Changes to meta tags, title, or linked CSS/JS files can affect how the proposal is displayed or interpreted.

Troubleshooting

  • The diff shows the whole file as changed. This usually means line endings differ (Windows CRLF vs. Mac/Linux LF). Convert both files to the same line endings using your editor’s “Save with Encoding” or a tool like dos2unix.
  • The online diff tool times out on large files. Break the HTML into smaller chunks (e.g., copy each <section> into a separate file) and compare those individually.
  • You cannot find a change you know exists. Search for a unique word from the old version in the new version. If it is not there, the change might be in a part of the HTML that is generated by JavaScript. In that case, open the browser’s developer tools (F12) and inspect the rendered DOM instead of the source file.
  • The command-line diff output is confusing. Use the --side-by-side flag on Linux/macOS (diff -y) or try a GUI tool like Meld (free) or WinMerge (Windows).
  • Changes are hidden inside long lines. Use a diff tool that highlights characters within a line, not just whole lines. Many online tools do this automatically; for command-line, use git diff --word-diff if you have Git installed.

Frequently Asked Questions

Can I compare two versions without a diff tool?

Yes, you can open both in side-by-side browser windows and manually scan, but this is error-prone for anything longer than a page. A diff tool is strongly recommended.

What if the HTML files are not saved locally but are on a website?

Use your browser’s “View Source” (Ctrl+U or Cmd+U) on each page, copy the source, and paste it into an online diff tool. For dynamic pages, you may need to use “Inspect Element” and copy the outer HTML of the relevant container.

How do I ignore changes to CSS classes that don’t affect the text?

Most diff tools let you filter by regex. You can replace all class="..." attributes with a placeholder before diffing, or simply focus on lines that contain visible text.

What does “+ 0 * sqrt(difference)” mean in the calculator context?

That is a trick used in calculator formulas to force a “Cannot compute” error when two inputs conflict (e.g., end date before start date). It is not relevant to comparing HTML files.

Is there a way to compare just the text content, ignoring all HTML tags?

Yes. Copy the HTML into a text editor, use find-and-replace to remove all tags (regex: <[^>]*>), then save as plain text and compare those text files.

What if the proposal is in PDF format, not HTML?

Convert both PDFs to text using a tool like pdftotext (Linux/macOS) or Adobe Acrobat’s “Export To > Text,” then compare the resulting text files. The method is the same.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →