{"id":32,"date":"2026-06-24T22:30:00","date_gmt":"2026-06-24T22:30:00","guid":{"rendered":"https:\/\/toolskit.site\/index.php\/advanced-text-diff-checker\/"},"modified":"2026-06-24T22:30:00","modified_gmt":"2026-06-24T22:30:00","slug":"advanced-text-diff-checker","status":"publish","type":"page","link":"https:\/\/toolskit.site\/index.php\/advanced-text-diff-checker\/","title":{"rendered":"Advanced Text Diff Checker"},"content":{"rendered":"<div class=\"hth-single-tool-shell\" style=\"--hth-color:#00e5ff\">\n<div id=\"tdiff-ultimate-wrapper\">\n<style>#tdiff-ultimate-wrapper{display:block;font-family:system-ui,'Segoe UI Emoji','Apple Color Emoji','Noto Color Emoji',sans-serif;line-height:1.5;color:#e0e0e0}#tdiff-ultimate-wrapper *,#tdiff-ultimate-wrapper *::before,#tdiff-ultimate-wrapper *::after{box-sizing:border-box;margin:0;padding:0}#tdiff-ultimate-wrapper .tool-container{width:100%;max-width:1000px;margin:20px auto;background:radial-gradient(circle at 20% 20%,#1f1f35,#0a0a18);border:1px solid rgba(0,229,255,0.15);border-radius:44px;padding:35px 30px;box-shadow:0 20px 60px rgba(0,0,0,0.7),0 0 50px rgba(0,229,255,0.05);animation:tdiff-popIn 0.6s cubic-bezier(0.175,0.885,0.32,1.275)}@keyframes tdiff-popIn{0%{opacity:0;transform:scale(0.94) translateY(35px)}100%{opacity:1;transform:scale(1) translateY(0)}}#tdiff-ultimate-wrapper .header{text-align:center;margin-bottom:28px}#tdiff-ultimate-wrapper .icon{font-size:48px;animation:tdiff-bounce 2s infinite;line-height:1}@keyframes tdiff-bounce{0%,100%{transform:translateY(0)}50%{transform:translateY(-10px)}}#tdiff-ultimate-wrapper h1{font-size:clamp(28px,6vw,40px);font-weight:800;background:linear-gradient(to right,#00e5ff,#ff80ab,#b388ff);-webkit-background-clip:text;-webkit-text-fill-color:transparent!important;background-clip:text;color:transparent;margin:8px 0 6px}#tdiff-ultimate-wrapper .subtitle{color:#aaa;font-size:15px}#tdiff-ultimate-wrapper .input-panels{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-bottom:22px}@media(max-width:700px){#tdiff-ultimate-wrapper .input-panels{grid-template-columns:1fr}}#tdiff-ultimate-wrapper .panel-label{font-size:13px;color:#888;text-transform:uppercase;letter-spacing:0.6px;margin-bottom:8px;display:flex;align-items:center;gap:6px}#tdiff-ultimate-wrapper textarea{width:100%;min-height:180px;background:rgba(255,255,255,0.04);border:1px solid rgba(255,255,255,0.08);border-radius:24px;color:#fff;padding:16px;font-size:14px;font-family:'Courier New',monospace;resize:vertical;outline:none;transition:border 0.3s}#tdiff-ultimate-wrapper textarea:focus{border-color:#7c4dff;box-shadow:0 0 25px rgba(124,77,255,0.2)}#tdiff-ultimate-wrapper .options-row{display:flex;flex-wrap:wrap;gap:12px;margin:15px 0;align-items:center}#tdiff-ultimate-wrapper .option-item{display:flex;align-items:center;gap:6px;font-size:13px;color:#ccc}#tdiff-ultimate-wrapper input[type=\"checkbox\"]{accent-color:#00e5ff;width:16px;height:16px;cursor:pointer}#tdiff-ultimate-wrapper select{background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.15);border-radius:20px;padding:6px 28px 6px 12px;color:#fff;font-size:13px;font-weight:500;appearance:none;cursor:pointer;outline:none;background-image:url(\"data:image\/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http:\/\/www.w3.org\/2000\/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23aaa' stroke-width='1.5' stroke-linecap='round'\/%3E%3C\/svg%3E\");background-repeat:no-repeat;background-position:right 10px center;background-size:10px;font-family:inherit}#tdiff-ultimate-wrapper select option{background:#1a1a2e;color:#fff}#tdiff-ultimate-wrapper .btn-group{display:flex;gap:12px;flex-wrap:wrap;margin:18px 0}#tdiff-ultimate-wrapper button{background:rgba(255,255,255,0.04);border:1px solid rgba(255,255,255,0.12);color:#ddd;padding:10px 20px;border-radius:30px;cursor:pointer;font-size:13px;font-weight:600;display:flex;align-items:center;gap:6px;transition:0.3s;font-family:inherit}#tdiff-ultimate-wrapper button:hover{background:rgba(124,77,255,0.2);border-color:#7c4dff;transform:translateY(-2px)}#tdiff-ultimate-wrapper button.primary{background:linear-gradient(135deg,#7c4dff,#00e5ff);border:none;color:#000;font-weight:700}#tdiff-ultimate-wrapper button.primary:hover{box-shadow:0 8px 20px rgba(0,229,255,0.3)}#tdiff-ultimate-wrapper .diff-output{background:rgba(0,0,0,0.35);border:1px solid rgba(255,255,255,0.06);border-radius:24px;padding:18px;margin-top:16px;max-height:450px;overflow-y:auto;font-family:'Courier New',monospace;font-size:14px;line-height:1.6}#tdiff-ultimate-wrapper .diff-line{padding:2px 8px;margin:1px 0;border-radius:4px;white-space:pre-wrap;word-break:break-all}#tdiff-ultimate-wrapper .diff-line.added{background:rgba(0,230,118,0.1);border-left:3px solid #00e676;color:#c8ffb0}#tdiff-ultimate-wrapper .diff-line.removed{background:rgba(255,23,68,0.1);border-left:3px solid #ff5252;color:#ffb0b0}#tdiff-ultimate-wrapper .diff-line.unchanged{color:#777;border-left:3px solid transparent}#tdiff-ultimate-wrapper .diff-line .line-number{display:inline-block;width:35px;text-align:right;margin-right:10px;color:#555;font-size:12px;user-select:none}#tdiff-ultimate-wrapper .diff-word-add{background:rgba(0,230,118,0.35);border-radius:3px;padding:0 2px;color:#fff;font-weight:600}#tdiff-ultimate-wrapper .diff-word-rem{background:rgba(255,23,68,0.35);border-radius:3px;padding:0 2px;color:#fff;text-decoration:line-through;font-weight:600}#tdiff-ultimate-wrapper .diff-stats{display:flex;gap:20px;flex-wrap:wrap;margin-top:12px;font-size:13px;color:#aaa}@media(max-width:500px){#tdiff-ultimate-wrapper .tool-container{padding:22px 16px}#tdiff-ultimate-wrapper .diff-output{font-size:12px}}<\/style>\n<div class=\"tool-container\">\n<div class=\"header\">\n<div class=\"icon\">&#x1F4CA;<\/div>\n<h1>Advanced Text Diff Checker<\/h1>\n<div class=\"subtitle\">Line &amp; Word diff \u00b7 Side-by-side \u00b7 Line numbers \u00b7 Export HTML \u00b7 Ctrl+Enter<\/div>\n<\/div>\n<div class=\"input-panels\">\n<div>\n<div class=\"panel-label\">&#x1F4C4; Original Text<\/div>\n<p><textarea id=\"tdiffOriginal\" placeholder=\"Paste original text here...\"><\/textarea><\/div>\n<div>\n<div class=\"panel-label\">&#x1F4DD; Modified Text<\/div>\n<p><textarea id=\"tdiffModified\" placeholder=\"Paste modified text here...\"><\/textarea><\/div>\n<\/div>\n<div class=\"options-row\"><label class=\"option-item\"><input type=\"checkbox\" id=\"tdiffIgnoreCase\"> Ignore Case<\/label><label class=\"option-item\"><input type=\"checkbox\" id=\"tdiffIgnoreWhitespace\"> Trim Whitespace<\/label><label class=\"option-item\"><input type=\"checkbox\" id=\"tdiffWordDiff\"> Word Diff Highlight<\/label><label class=\"option-item\"><input type=\"checkbox\" id=\"tdiffLineNumbers\" checked> Line Numbers<\/label><\/p>\n<div class=\"option-item\"><span style=\"color:#aaa;\">View:<\/span><select id=\"tdiffViewMode\"><option value=\"unified\" selected>Unified<\/option><option value=\"sidebyside\">Side-by-side<\/option><\/select><\/div>\n<\/div>\n<div class=\"btn-group\"><button class=\"primary\" id=\"tdiffCompareBtn\">&#x1F50D; Compare (Ctrl+Enter)<\/button><button id=\"tdiffSwapBtn\">&#x1F503; Swap<\/button><button id=\"tdiffCopyOnlyChangesBtn\">&#x1F4CB; Copy Changes<\/button><button id=\"tdiffCopyFullBtn\">&#x1F4CB; Copy Full Diff<\/button><button id=\"tdiffExportHtmlBtn\">&#x1F310; Export HTML<\/button><button id=\"tdiffDownloadBtn\">&#x1F4BE; Download<\/button><button id=\"tdiffClearBtn\">&#x1F5D1;&#xFE0F; Clear<\/button><\/div>\n<div class=\"diff-output\" id=\"tdiffOutput\"><span style=\"color:#555;\">Enter both texts and click Compare to see differences&#8230;<\/span><\/div>\n<div class=\"diff-stats\" id=\"tdiffStats\"><\/div>\n<\/div>\n<p><script>(function(){var originalArea=document.getElementById('tdiffOriginal');var modifiedArea=document.getElementById('tdiffModified');var ignoreCaseCheck=document.getElementById('tdiffIgnoreCase');var ignoreWhitespaceCheck=document.getElementById('tdiffIgnoreWhitespace');var wordDiffCheck=document.getElementById('tdiffWordDiff');var lineNumbersCheck=document.getElementById('tdiffLineNumbers');var viewModeSelect=document.getElementById('tdiffViewMode');var outputDiv=document.getElementById('tdiffOutput');var statsDiv=document.getElementById('tdiffStats');var currentDiffData={added:[],removed:[],fullUnified:'',fullSideBySide:'',stats:null};function escapeHTML(str){return str.replace(\/&\/g,'&amp;').replace(\/<\/g,'&lt;').replace(\/>\/g,'&gt;')}function wordDiffHighlight(origLine,modLine){var origWords=origLine.split(\/(s+)\/);var modWords=modLine.split(\/(s+)\/);var result={orig:'',mod:''};var maxLen=Math.max(origWords.length,modWords.length);for(var i=0;i<maxLen;i++){var ow=origWords[i]||'';var mw=modWords[i]||'';if(ow===mw){result.orig+=escapeHTML(ow);result.mod+=escapeHTML(mw)}else{if(ow)result.orig+='<span class=\"diff-word-rem\">'+escapeHTML(ow)+'<\/span>';if(mw)result.mod+='<span class=\"diff-word-add\">'+escapeHTML(mw)+'<\/span>'}}return result}function buildLine(line,type,lineNum){var lineNumberHtml='';if(lineNumbersCheck.checked){lineNumberHtml='<span class=\"line-number\">'+(lineNum||'')+'<\/span>'}return '<\/p>\n<div class=\"diff-line '+type+'\">'+lineNumberHtml+line+'<\/div>\n<p>'}function generateDiff(){var origLines=originalArea.value.split(\/r?n\/);var modLines=modifiedArea.value.split(\/r?n\/);if(ignoreWhitespaceCheck.checked){origLines=origLines.map(function(l){return l.trim()});modLines=modLines.map(function(l){return l.trim()})}if(ignoreCaseCheck.checked){origLines=origLines.map(function(l){return l.toLowerCase()});modLines=modLines.map(function(l){return l.toLowerCase()})}var maxLen=Math.max(origLines.length,modLines.length);var addedCount=0,removedCount=0,unchangedCount=0;var unifiedHtml='';var sideBySideHtml='<\/p>\n<div style=\"display:grid;grid-template-columns:1fr 1fr;gap:16px;\">';sideBySideHtml+='<\/p>\n<div><strong style=\"color:#ff5252;\">Original<\/strong><\/div>\n<div><strong style=\"color:#00e676;\">Modified<\/strong><\/div>\n<p>';var addedLines=[];var removedLines=[];for(var i=0;i<maxLen;i++){var o=origLines[i]!==undefined?origLines[i]:'';var m=modLines[i]!==undefined?modLines[i]:'';if(o===m){var emptyDisplay=escapeHTML('(empty)');if(o===''&#038;&#038;m===''){unifiedHtml+=buildLine('(empty line)','unchanged',i+1);sideBySideHtml+='\n\n<div class=\"diff-line unchanged\">'+(lineNumbersCheck.checked?'<span class=\"line-number\">'+(i+1)+'<\/span>':'')+emptyDisplay+'<\/div>\n<p>';sideBySideHtml+='<\/p>\n<div class=\"diff-line unchanged\">'+(lineNumbersCheck.checked?'<span class=\"line-number\">'+(i+1)+'<\/span>':'')+emptyDisplay+'<\/div>\n<p>'}else{unifiedHtml+=buildLine(escapeHTML(o),'unchanged',i+1);sideBySideHtml+='<\/p>\n<div class=\"diff-line unchanged\">'+(lineNumbersCheck.checked?'<span class=\"line-number\">'+(i+1)+'<\/span>':'')+escapeHTML(o)+'<\/div>\n<p>';sideBySideHtml+='<\/p>\n<div class=\"diff-line unchanged\">'+(lineNumbersCheck.checked?'<span class=\"line-number\">'+(i+1)+'<\/span>':'')+escapeHTML(m)+'<\/div>\n<p>'}unchangedCount++}else{if(origLines[i]!==undefined&&modLines[i]!==undefined){var origDisplay=o,modDisplay=m;if(wordDiffCheck.checked){var wordDiff=wordDiffHighlight(o,m);origDisplay=wordDiff.orig;modDisplay=wordDiff.mod}else{origDisplay=escapeHTML(o);modDisplay=escapeHTML(m)}unifiedHtml+=buildLine('- '+origDisplay,'removed',i+1);unifiedHtml+=buildLine('+ '+modDisplay,'added',i+1);sideBySideHtml+='<\/p>\n<div class=\"diff-line removed\">'+(lineNumbersCheck.checked?'<span class=\"line-number\">'+(i+1)+'<\/span>':'')+origDisplay+'<\/div>\n<p>';sideBySideHtml+='<\/p>\n<div class=\"diff-line added\">'+(lineNumbersCheck.checked?'<span class=\"line-number\">'+(i+1)+'<\/span>':'')+modDisplay+'<\/div>\n<p>';removedCount++;addedCount++;removedLines.push(o);addedLines.push(m)}else if(origLines[i]===undefined){unifiedHtml+=buildLine('+ '+escapeHTML(m),'added',i+1);sideBySideHtml+='<\/p>\n<div class=\"diff-line unchanged\"><\/div>\n<p>';sideBySideHtml+='<\/p>\n<div class=\"diff-line added\">'+(lineNumbersCheck.checked?'<span class=\"line-number\">'+(i+1)+'<\/span>':'')+escapeHTML(m)+'<\/div>\n<p>';addedCount++;addedLines.push(m)}else{unifiedHtml+=buildLine('- '+escapeHTML(o),'removed',i+1);sideBySideHtml+='<\/p>\n<div class=\"diff-line removed\">'+(lineNumbersCheck.checked?'<span class=\"line-number\">'+(i+1)+'<\/span>':'')+escapeHTML(o)+'<\/div>\n<p>';sideBySideHtml+='<\/p>\n<div class=\"diff-line unchanged\"><\/div>\n<p>';removedCount++;removedLines.push(o)}}}sideBySideHtml+='<\/p><\/div>\n<p>';currentDiffData={added:addedLines,removed:removedLines,fullUnified:unifiedHtml,fullSideBySide:sideBySideHtml,stats:{addedCount:addedCount,removedCount:removedCount,unchangedCount:unchangedCount,maxLen:maxLen}};displayDiff()}function displayDiff(){var viewMode=viewModeSelect.value;var html='';if(viewMode==='unified'){html=currentDiffData.fullUnified||'<span style=\"color:#555;\">No differences.<\/span>'}else{html=currentDiffData.fullSideBySide||'<span style=\"color:#555;\">No differences.<\/span>'}outputDiv.innerHTML=html;var stats=currentDiffData.stats;if(stats){var similarity=stats.maxLen>0?Math.round((stats.unchangedCount\/stats.maxLen)*100):0;statsDiv.innerHTML='<span style=\"color:#00e676;\">Added: '+stats.addedCount+'<\/span> '+'<span style=\"color:#ff5252;\">Removed: '+stats.removedCount+'<\/span> '+'<span style=\"color:#aaa;\">Unchanged: '+stats.unchangedCount+'<\/span> '+'<span style=\"color:#aaa;\">Total: '+stats.maxLen+'<\/span> '+'<span style=\"color:#aaa;\">('+similarity+'% similar)<\/span>'}}function swapTexts(){var temp=originalArea.value;originalArea.value=modifiedArea.value;modifiedArea.value=temp;generateDiff()}function copyFullDiff(){var diffText=outputDiv.innerText;if(!diffText.trim())return;navigator.clipboard.writeText(diffText).then(function(){var btn=document.getElementById('tdiffCopyFullBtn');btn.textContent='u2705 Copied!';setTimeout(function(){btn.textContent='u{1F4CB} Copy Full Diff'},1500)})}function copyOnlyChanges(){var changes=currentDiffData.removed.map(function(l){return '- '+l}).concat(currentDiffData.added.map(function(l){return '+ '+l})).join('n');if(!changes.trim())return;navigator.clipboard.writeText(changes).then(function(){var btn=document.getElementById('tdiffCopyOnlyChangesBtn');btn.textContent='u2705 Copied!';setTimeout(function(){btn.textContent='u{1F4CB} Copy Changes'},1500)})}function exportHtml(){var viewMode=viewModeSelect.value;var htmlContent=(viewMode==='unified')?currentDiffData.fullUnified:currentDiffData.fullSideBySide;if(!htmlContent)return;var fullHtml='<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><title>Text Diff<\/title><\/p>\n<style>.diff-line.added{background:rgba(0,230,118,0.1);border-left:3px solid #00e676;padding:2px 8px;color:#c8ffb0}.diff-line.removed{background:rgba(255,23,68,0.1);border-left:3px solid #ff5252;padding:2px 8px;color:#ffb0b0}.diff-line.unchanged{color:#777;border-left:3px solid transparent;padding:2px 8px}.diff-word-add{background:rgba(0,230,118,0.35);border-radius:3px;padding:0 2px;color:#fff;font-weight:600}.diff-word-rem{background:rgba(255,23,68,0.35);border-radius:3px;padding:0 2px;color:#fff;text-decoration:line-through}<\/style>\n<p><\/head><body style=\"background:#0a0a18;color:#ccc;font-family:monospace;\">'+htmlContent+'<\/body><\/html>';var blob=new Blob([fullHtml],{type:'text\/html'});var a=document.createElement('a');a.href=URL.createObjectURL(blob);a.download='text-diff.html';a.click();URL.revokeObjectURL(a.href)}function downloadDiff(){var diffText=outputDiv.innerText;if(!diffText.trim())return;var blob=new Blob([diffText],{type:'text\/plain'});var a=document.createElement('a');a.href=URL.createObjectURL(blob);a.download='text-diff.txt';a.click();URL.revokeObjectURL(a.href)}function clearAll(){originalArea.value='';modifiedArea.value='';outputDiv.innerHTML='<span style=\"color:#555;\">Enter both texts and click Compare to see differences...<\/span>';statsDiv.innerHTML='';currentDiffData={added:[],removed:[],fullUnified:'',fullSideBySide:'',stats:null}}document.getElementById('tdiffCompareBtn').addEventListener('click',generateDiff);document.getElementById('tdiffSwapBtn').addEventListener('click',swapTexts);document.getElementById('tdiffCopyFullBtn').addEventListener('click',copyFullDiff);document.getElementById('tdiffCopyOnlyChangesBtn').addEventListener('click',copyOnlyChanges);document.getElementById('tdiffExportHtmlBtn').addEventListener('click',exportHtml);document.getElementById('tdiffDownloadBtn').addEventListener('click',downloadDiff);document.getElementById('tdiffClearBtn').addEventListener('click',clearAll);viewModeSelect.addEventListener('change',displayDiff);wordDiffCheck.addEventListener('change',generateDiff);lineNumbersCheck.addEventListener('change',generateDiff);ignoreCaseCheck.addEventListener('change',generateDiff);ignoreWhitespaceCheck.addEventListener('change',generateDiff);document.addEventListener('keydown',function(e){if((e.ctrlKey||e.metaKey)&&e.key==='Enter'){e.preventDefault();generateDiff()}});originalArea.value='Hello worldnThis is a test.nGoodbye world.';modifiedArea.value='Hello worldnThis is a demo.nGoodbye universe.nNew line.';generateDiff()})();<\/script><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Compare two texts with line &#038; word diff highlighting, side-by-side\/unified view, line numbers, ignore case\/whitespace, copy changes\/full diff, export HTML, download, and Ctrl+Enter shortcut.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-32","page","type-page","status-publish"],"_links":{"self":[{"href":"https:\/\/toolskit.site\/index.php\/wp-json\/wp\/v2\/pages\/32","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/toolskit.site\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/toolskit.site\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/toolskit.site\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/toolskit.site\/index.php\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":0,"href":"https:\/\/toolskit.site\/index.php\/wp-json\/wp\/v2\/pages\/32\/revisions"}],"wp:attachment":[{"href":"https:\/\/toolskit.site\/index.php\/wp-json\/wp\/v2\/media?parent=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}