diff --git a/web/viewer.js b/web/viewer.js
index 80c25aafb..214b272fd 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -2365,6 +2365,18 @@ var TextLayerBuilder = function textLayerBuilder(textLayerDiv, pageIdx) {
     return ret;
   };
 
+  this.clearMatches = function textLayerBuilder_clearMatches() {
+    var textDivs = this.textDivs;
+
+    // Clear all previous highlights
+    textDivs.forEach(function(div) {
+      var spans = div.querySelectorAll('span');
+      for (var i = 0, ii = spans.length; i < ii; i++) {
+        spans[i].className = '';
+      }
+    });
+  }
+
   this.renderMatches = function textLayerBuilder_renderMatches(matches) {
     var bidiTexts = this.textContent.bidiTexts;
     var textDivs = this.textDivs;
@@ -2372,6 +2384,8 @@ var TextLayerBuilder = function textLayerBuilder(textLayerDiv, pageIdx) {
     var isSelectedPage = this.pageIdx === PDFFindController.selected.pageIdx;
     var selectedMatchIdx = PDFFindController.selected.matchIdx;
 
+    this.clearMatches();
+
     var infty = {
       divIdx: -1,
       offset: undefined