File Compare Tool – Compare Text, Code, PDFs, Word & Excel Files Instantly

Instant use · No signup · No data saving

Original (File 1)

No file · paste text below

Modified (File 2)

No file · paste text below
Compare mode: Context:
0Added
0Removed
0Changed lines
100%Similarity

✨ AI Summary of Changes

Working...

Please wait

Secure Processing

Files are encrypted in transit and auto-deleted after processing.

Fast Conversion

Optimized engine returns most files in just a few seconds.

No Installation

Everything runs in your browser — nothing to download or set up.

AI Powered

Built-in AI for chat, summaries, translation and smart extraction.

'; const blob = new Blob([html], { type:'application/msword' }); const a = document.createElement('a'); a.href = URL.createObjectURL(blob); a.download = 'comparison.doc'; a.click(); } function downloadExcel() { if (!lastExcelDiff) return; const wb = XLSX.utils.book_new(); lastExcelDiff.sheets.forEach(sheet => { const data = []; // Header row const header = ['Row #', 'Status']; for (let c = 0; c < sheet.maxCols; c++) header.push('Col ' + (c+1)); data.push(header); sheet.rows.forEach(r => { const row = [r.index + 1, r.status]; r.cells.forEach(cell => { if (r.status === 'changed' && cell.changed) row.push(cell.before + ' → ' + cell.after); else row.push(r.status === 'removed' ? cell.before : cell.after); }); data.push(row); }); const ws = XLSX.utils.aoa_to_sheet(data); XLSX.utils.book_append_sheet(wb, ws, sheet.name.slice(0, 31)); }); XLSX.writeFile(wb, 'excel-diff.xlsx'); } function copyLink(btn) { navigator.clipboard.writeText(window.location.href).then(() => { const old = btn.textContent; btn.textContent = '✓ Copied'; setTimeout(() => btn.textContent = old, 1500); }); } function shareWhatsApp() { if (!lastDiff && !lastExcelDiff) { setStatus('Run comparison first', 'err'); return; } const adds = document.getElementById('addCount').textContent; const rems = document.getElementById('remCount').textContent; const sim = document.getElementById('simPct').textContent; const msg = '📊 File Comparison Result (HuntPDF)\n' + '➕ Added: ' + adds + '\n' + '➖ Removed: ' + rems + '\n' + '📈 Similarity: ' + sim + '\n\n' + 'Compare your own at huntpdf.com/tools/file-compare.html'; window.open('https://wa.me/?text=' + encodeURIComponent(msg), '_blank'); } function shareEmail() { if (!lastDiff && !lastExcelDiff) { setStatus('Run comparison first', 'err'); return; } const txt = buildDiffText(); window.location.href = 'mailto:?subject=' + encodeURIComponent('File Comparison Result') + '&body=' + encodeURIComponent(txt.slice(0, 4000) + '\n\nMade with HuntPDF — huntpdf.com'); }