A powerful web-based tool for comparing text files or direct text input with word-level difference highlighting.
- Word-Level Difference Detection: Identifies and highlights specific words that differ between two texts
- Side-by-Side Comparison: Clear visual presentation of differences
- Synchronized Scrolling: Both panels scroll together (can be toggled)
- Line Numbers: Easy reference with line numbering
- Statistics: Shows counts of additions, deletions, and changes
- Flexible Input: Support for both file uploads and direct text entry
- Responsive Design: Works on desktop and mobile devices
# Clone the repository
git clone https://github.com/yourusername/diff-viewer.git
cd diff-viewer
# Install dependencies
pip install -r requirements.txtRun the application:
python app.pyThen open your browser to the URL shown in the terminal (typically http://127.0.0.1:7860).
- Upload two text files
- Click "Compare Files"
- View the differences highlighted in the output
- Paste text into the "Original Text" area
- Paste modified text into the "Modified Text" area
- Click "Compare Texts"
- View the differences highlighted in the output
The application uses Python's difflib module to detect differences between texts at both the line and word level. The differences are then displayed with color coding:
- Green: Added content
- Red: Deleted content
- Yellow: Changed content
MIT License
