A web-based Excel file comparison tool that helps you identify differences between two Excel files quickly and easily. Runs completely in your browser with no server uploads required.
| Upload Interface | Sheet Selection | Unified Diff View |
|---|---|---|
![]() |
![]() |
![]() |
- π Drag & Drop Support - Simply drag and drop Excel files to compare
- π Unified Table View - View differences in a single unified table with old/new row indices
- π― Custom Header Row Selection - Choose which row contains headers (default: Row 1) β NEW
- π Key Column Selection - Select which column to use for row matching β NEW
- π€ Auto-Detect Common Columns - Automatically finds matching columns between files β NEW
- π― Smart Column Matching - Intelligently matches columns by header content, not position
- π Cell-Level Diff - Highlights individual cell changes with old β new value display
- π Column Reordering Handling - Correctly matches columns even when reordered
- π― Change Navigation - Jump between changes with Previous/Next buttons or keyboard shortcuts (P/N)
- π±οΈ Click-to-Navigate - Click any changed cell to jump to that change
- π Visual Change Counter - Track your position through changes (e.g., "5 / 23")
- π‘ Visual Indicators - Color-coded cells for easy identification of changes
- π 100% Local - All processing happens in your browser, no data leaves your device
- π No Server Required - Runs entirely client-side
-
Custom Header Row Selection: Choose which row contains your headers (not limited to Row 1)
- Supports any row from 1-50 as header row
- Independent selection for File A and File B
- Automatically adjusts row numbering based on selected header
-
Key Column Selection: Choose which column to use for row matching
- Auto-detects common columns between both files
- No longer limited to Column A for row matching
- Intelligently suggests best matching column
-
Smart Column Detection: Automatically finds columns that exist in both files
- Case-insensitive header matching
- Warns when no common columns are found
-
Dynamic Row Numbering: Excel row numbers now correctly reflect selected header row
- If header is Row 3, data rows start at 4 (not 2)
- Accurate row numbers in Old/New index columns
- β Fixed row number display when using non-default header rows
- β Corrected Excel row calculation for data rows
- β Improved row matching accuracy with custom key columns
.xlsx- Excel 2007+ files.xls- Excel 97-2003 files
File Size Limit: 50MB per file
No installation required! Just a modern web browser:
- Chrome (recommended)
- Firefox
- Safari
- Edge
- Clone the repository:
git clone https://github.com/HackettLai/excel-differ.git
cd excel-differ- Open
index.htmlin your web browser:
# On macOS
open index.html
# On Linux
xdg-open index.html
# On Windows
start index.htmlThat's it! No build process or dependencies to install.
-
Upload Files
- Click "Select File" or drag & drop your Excel files into the upload areas
- File A: Original/older version
- File B: New/updated version
-
Start Comparison
- Click the "Start Comparing" button
- Wait for files to be parsed and compared
-
Configure Comparison Settings
a. Select Header Rows (default: Row 1)
- Choose which row contains column headers for File A
- Choose which row contains column headers for File B
- Supports rows 1-50
b. Select Key Column (auto-detected)
- Tool automatically detects common columns between files
- Select which column to use for matching rows
- Example: "Employee ID", "Order Number", "Product Code"
β οΈ If no common columns found, you may need to add one manually
c. Click "Compare" to view differences
-
Review Differences
- View all changes in a unified table
- See old/new row indices for each row
- Modified cells show "old value β new value"
- Added columns marked with green header (+B)
- Deleted columns marked with red header (βD)
-
Navigate Changes
- Click "Previous" or "Next" buttons to jump between changes
- Use keyboard shortcuts:
Pfor previous,Nfor next - Click directly on any changed cell to navigate to it
- Track your position with the change counter (e.g., "5 / 23")
- Row 1: Column letters with indicators
- Normal columns:
A,B,C - Added columns:
+B(green background) - Deleted columns:
βD(red background)
- Normal columns:
- Row 2: Header content
- Shows actual header text from Excel
(Blank Column)for columns without headers
- Old Column: Row number in File A (or
-if row was added) - New Column: Row number in File B (or
-if row was deleted)
- π’ Green Background - Cell in added column or added row
- π΄ Red Background - Cell in deleted column or deleted row
- π‘ Yellow Background - Cell value was modified (shows old β new)
- βͺ White Background - Unchanged cell
- Modified cells:
old value β new value - Empty cells: Shown as
Blankin italic gray text - Normal cells: Display current value
excel-differ/
βββ index.html # Main HTML file
βββ styles.css # Styling and layout
βββ js/
β βββ main.js # Application entry point and controller
β βββ fileHandler.js # File upload, drag-and-drop, validation
β βββ excelParser.js # Excel parsing using SheetJS
β βββ diffEngine.js # Core comparison algorithm
β βββ diffViewer.js # Unified table renderer and navigation
β βββ copyright.js # Copyright year management
βββ README.md # This file
- Pure JavaScript (ES6+) - No frameworks, vanilla JS with modules
- SheetJS (xlsx) - Excel file parsing
- HTML5 - Modern web standards
- CSS3 - Styling, animations, and responsive design
- File API - Browser-native file handling
- Keyboard API - Keyboard shortcut support
| Browser | Version | Status |
|---|---|---|
| Chrome | 90+ | β Fully Supported |
| Firefox | 88+ | β Fully Supported |
| Safari | 14+ | β Fully Supported |
| Edge | 90+ | β Fully Supported |
The tool matches columns by header content, not position:
- Header-Based Matching: Columns with identical header text are matched
- Example: If "Email Address" moves from column G to H, it's still matched correctly
- Reordering Tolerance: Column position changes don't trigger false positives
- Cells are compared based on what column they logically belong to
- Reordered columns are NOT marked as added/deleted
- True Add/Delete Detection: Only reports genuine column additions/deletions
- Added column: Header exists in File B but not in File A
- Deleted column: Header exists in File A but not in File B
Quickly navigate through all cell-level changes:
- Previous/Next Buttons - Navigate sequentially through changes
- Keyboard Shortcuts - Press
Pfor previous,Nfor next- Only active when not typing in input fields
- Works globally across the page
- Click Navigation - Click any changed cell to jump to that change
- Updates current position in navigation sequence
- Automatically scrolls cell into view
- Change Counter - Shows current position and total changes (e.g., "5 / 23")
- Updates dynamically as you navigate
- Displays
0 / 0when no changes exist
- Visual Highlight - Briefly highlights the target cell when navigating
- 2-second highlight with CSS animation
- Smooth scroll with centering
Rows are matched using a user-selected Key Column:
-
Key Column Selection:
- Choose any column that exists in both files
- Auto-detects common columns by comparing headers
- Case-insensitive matching (e.g., "ID" matches "id")
- No longer limited to Column A
-
Key-Based Matching:
- Uses selected key column value to identify matching rows
- Example: If "Employee ID" is selected:
- Row with ID "12345" in File A matches ID "12345" in File B
- Even if row positions differ, they're still matched
-
Fallback for Empty Keys:
- For rows without key values, uses position-based matching
- Compares all columns to ensure exact match
-
Add/Delete Detection:
- Added row: Key exists in File B but not in File A
- Deleted row: Key exists in File A but not in File B
- Efficient diff algorithm with minimal memory footprint
- Lazy DOM manipulation for large spreadsheets
- Optimized scroll event handling
- Smart cell collection for navigation
Excel Differ uses a multi-step pipeline to detect changes:
- File Parsing - Reads Excel files using SheetJS into JavaScript objects
- Column Matching - Matches columns by header content (not position)
- Row Matching - Matches rows using user-selected Key Column as unique identifier
- Cell Comparison - Compares matched cells and detects modifications
Key Features:
- β Handles column reordering (matches by header name)
- β Handles row reordering (matches by Key Column value)
- β Detects added/deleted columns and rows
- β Highlights modified cells with old β new display
Important Design Decision:
- Row matching relies on Key Column values - This enables accurate detection of row reordering, but requires the Key Column to contain stable unique identifiers
- If Key Column values change, rows cannot be matched correctly (see Limitations for details)
π Read detailed technical documentation β
| Key | Action | Description |
|---|---|---|
P |
Previous Change | Jump to previous changed cell |
N |
Next Change | Jump to next changed cell |
Note: Shortcuts are disabled when typing in input/textarea/select elements
Issue: Rows are matched using a single Key Column (user-selected)
Requirements:
- Must select a Key Column that exists in both files
- Key Column should contain stable, unique identifiers
- No common columns = Cannot compare rows
Impact:
- If Key Column values change between files, rows cannot be matched
- All cells in unmatched rows may show as added/deleted
Example: File A (using "ID" as key):
| ID | Name | Age|
| 101 | Peter | 34 |
File B (ID changed):
| ID | Name | Age|
| 102 | Peter | 34 | β Different ID!
Result: Treated as different rows (one deleted, one added) β
Solutions:
- β Use stable IDs (employee ID, product code, order number)
- β Add an ID column if your data doesn't have unique keys
- β Pre-process data to ensure consistent IDs before comparison
- β Select the correct Key Column that best identifies your rows
β οΈ Avoid using auto-incremented numbers that change between versions
Issue: Maximum 50MB per file
Reason: Browser memory limitations
Solutions:
- Split large files into smaller chunks
- Filter to relevant date ranges before comparison
- Remove unnecessary columns before uploading
- β Cell formatting (colors, fonts, borders)
- β Formulas (only computed values)
- β Charts and images
- β Merged cell information
- β Data validation rules
- β Conditional formatting rules
Alternative: Use Excel's built-in "Compare and Merge Workbooks" for format comparison
- Version Control: Compare different versions of Excel reports
- Data Auditing: Verify data changes in financial spreadsheets
- Quality Assurance: Validate data migrations or transformations
- Collaboration: Review changes made by team members
- Configuration Management: Track changes in Excel-based config files
- Format Comparison: Use Excel's built-in compare for formatting changes
- Large Dataset Analysis: Consider database tools for millions of rows
- Real-Time Collaboration: Use Google Sheets or Excel Online instead
- Formula Debugging: Use Excel's formula auditing tools
Files won't upload
- Check file size (must be under 50MB)
- Ensure file format is .xlsx or .xls
- Try re-saving the file in Excel
Comparison is slow
- Large files may take 10-30 seconds to process
- Close other browser tabs to free up memory
- Try comparing smaller sections of data
Changes not detected
- Ensure both files have matching sheet names
- Check that column headers match exactly
- Verify data types are consistent
Navigation buttons disabled
- No changes detected in selected sheets
- Try selecting different sheets to compare
No common columns found
- Check that both files have at least one column with identical header names
- Headers are case-insensitive ("Email" matches "email")
- Try renaming columns in Excel to match before uploading
- Ensure both files use the same header row (adjust Header Row selection)
Row numbers seem wrong
- Check that you selected the correct Header Row for each file
- Excel row numbers are calculated as: Header Row + 1 + Data Row Index
- Example: If Header Row = 3, first data row should be 4
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Use ES6+ JavaScript with modules
- Follow existing code structure and naming conventions
- Add comprehensive comments for complex logic
- Test with various Excel file formats and sizes
- Ensure browser compatibility
This project is licensed under the MIT License - see the LICENSE file for details.
- SheetJS for the excellent Excel parsing library
- Inspired by diff tools like Beyond Compare, WinMerge, and Git diff
- Built with assistance from Claude AI (Anthropic)
If you encounter issues or have questions:
- π Report a bug
- π‘ Request a feature
β If you find this tool useful, please consider giving it a star on GitHub!
Made with β€οΈ by Hackett.Lai


