A powerful, client-side text comparison tool for developers, writers, and content creators
Features β’ Installation β’ Usage β’ Examples β’ Contributing
π Repository: https://github.com/Megabre/compare
Megabre Compare is a sophisticated, browser-based text comparison tool designed to help you quickly identify differences between two text documents. Whether you're comparing code versions, reviewing document changes, or analyzing text variations, this tool provides an intuitive and efficient way to visualize differences line by line.
Built with modern web technologies, Megabre Compare runs entirely in your browserβyour data never leaves your device, ensuring complete privacy and security. Perfect for developers comparing code versions, content creators reviewing drafts, or anyone working with large documents who needs to spot subtle differences quickly.
- Line-by-line comparison: Compare two texts side by side with visual highlighting
- Word-level differences: Automatically highlights different words in red for easy identification
- Smart diff detection: Identifies added, removed, and modified lines instantly
- Skip to Differences: Jump directly to the next difference with a single click
- Show Only Differences: Filter view to display only lines that differ between texts
- Line numbering: Each line is numbered for easy reference and navigation
- Dark/Light Mode: Toggle between dark and light themes for comfortable viewing
- Responsive Design: Works seamlessly on desktop, tablet, and mobile devices
- Clean Interface: Minimalist design focused on functionality
- Text Cleaning: Remove unnecessary whitespace and formatting
- Case Conversion: Convert text to lowercase with one click
- Quick Clear: Reset input fields instantly
- 100% Client-Side: All processing happens in your browser
- No Data Transmission: Your texts never leave your device
- XSS Protection: Input sanitization prevents malicious code execution
- Privacy First: No tracking, no analytics, no data collection
π Website Links:
- Product Page: https://www.megabre.com/compare-pro.php
- Free Software Page: https://www.megabre.com/free-software.php
- Clone or download this repository from https://github.com/Megabre/compare
- Extract the files to your web server directory
- Open
index.phpin your browser
- Fork this repository
- Enable GitHub Pages in your repository settings
- Access your instance at
https://megabre.github.io/compare/
# Clone the repository
git clone https://github.com/Megabre/compare.git
# Navigate to the directory
cd compare
# Open in your browser
# Simply open index.php in your preferred browser- Enter Your Texts: Paste or type your first text in the left textarea
- Enter Comparison Text: Paste or type your second text in the right textarea
- Click Compare: Press the "Compare" button to analyze differences
- Review Results: Differences are highlighted automatically
- Click the "Skip Line / Show Differences" button to jump to the next difference
- Useful for navigating through large documents quickly
- Click "Show Only Differences" to hide identical lines
- Click again to restore the full view
- Clear: Remove all text from an input field
- Convert to Lowercase: Transform text to lowercase
- Remove Spaces: Clean up unnecessary whitespace
- Toggle dark/light mode using the button in the top-right corner
- Reduces eye strain during extended use
- Compare code versions before committing changes
- Review pull requests and code diffs
- Identify changes in configuration files
- Debug by comparing working vs. broken code
- Compare document revisions
- Review translations and localized content
- Check for consistency across multiple versions
- Identify formatting differences
- Compare article drafts
- Review SEO meta descriptions
- Check social media post variations
- Analyze A/B test content
- Compare contract versions
- Review policy documents
- Check legal document changes
- Audit report modifications
Original Code:
function calculateTotal(items) {
let total = 0;
for (let item of items) {
total += item.price;
}
return total;
}
Modified Code:
function calculateTotal(items) {
let total = 0;
for (let item of items) {
total += item.price * item.quantity;
}
return total;
}
Megabre Compare will highlight the difference in the calculation line, making it easy to spot the change.
Compare two versions of a document to see:
- Added paragraphs
- Removed sections
- Modified sentences
- Formatting changes
- Maximum Lines: 5,000 lines per text (prevents browser slowdown)
- Character Limit: ~100,000 characters per textarea
- Processing: Real-time comparison using efficient algorithms
- β Chrome/Edge (latest)
- β Firefox (latest)
- β Safari (latest)
- β Opera (latest)
- XSS Protection: All user input is sanitized using HTML entity encoding
- Input Validation: Length and line count limits prevent abuse
- No External Requests: Works completely offline after initial load
- HTML5: Semantic markup
- CSS3: Modern styling with dark mode support
- Vanilla JavaScript: No dependencies, pure JavaScript
- Client-Side Processing: All operations run in the browser
To modify the maximum line limit, edit app.js:
const lines1 = text1.split('\n').slice(0, 5000); // Change 5000 to your desired limit
const lines2 = text2.split('\n').slice(0, 5000);Edit style.css to change highlight colors:
.different-line {
background-color: #519b6296; /* Change this color */
}We welcome contributions! Here's how you can help:
- Fork the repository from https://github.com/Megabre/compare
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request on GitHub
- Add syntax highlighting for code comparison
- Implement export functionality (PDF, HTML, etc.)
- Add support for file uploads
- Create a command-line version
- Add more text processing utilities
- Improve mobile responsiveness
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with β€οΈ by the Megabre team
- Inspired by the need for efficient text comparison tools
- Thanks to all contributors and users
- Issues: GitHub Issues
- Website: https://www.megabre.com
- Repository: https://github.com/Megabre/compare
If you find this project useful, please consider giving it a β on GitHub!