Always work on a copy Before editing, save a copy to another folder, external drive, or cloud storage. Do not edit your only version. Save incremental copies when changing XML files (for example sharedStrings-v1.xml, sharedStrings-v2.xml).

What a Healthy sharedStrings.xml Looks Like

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
     count="22" uniqueCount="18">
  <si><t>Product</t></si>    <!-- index 0 -->
  <si><t>Region</t></si>     <!-- index 1 -->
  <si><t>Q1 Revenue</t></si> <!-- index 2 -->
  <si><t>Widget A</t></si>   <!-- index 3 -->
  <!-- ... -->
</sst>

count = total number of string references across the whole workbook (the same string in 10 cells counts 10 times).
uniqueCount = number of actual <si> entries in this file.

📄
CLEAN-sample-workbook.xlsx Clean Reference
A valid XLSX workbook — open, unzip, and inspect this file as a working reference while following the examples above.
Download

Type 1

count / uniqueCount Mismatch

The count and uniqueCount attributes on <sst> must accurately reflect the file's contents. When they don't, Excel will repair and may discard string data it cannot reconcile.

Excel error message
Repaired Records: String properties from /xl/sharedStrings.xml part
<!-- CORRUPT: count says 999 but only 4 entries exist -->
<sst count="999" uniqueCount="999">   <!-- ← wrong values -->
  <si><t>Product</t></si>
  <si><t>Region</t></si>
  <si><t>Widget A</t></si>
  <si><t>Widget B</t></si>
</sst>

Fix: Count the actual <si> entries and update uniqueCount to match. For count, setting it equal to uniqueCount is safe — Excel recalculates the true value on next save.

<!-- Fixed -->
<sst count="4" uniqueCount="4">
  <si><t>Product</t></si>
  <si><t>Region</t></si>
  <si><t>Widget A</t></si>
  <si><t>Widget B</t></si>
</sst>
📄
CORRUPT-sharedstrings-count-mismatch.xlsx Corrupt Example
count and uniqueCount are both set to 999, but only 4 string entries exist. Excel reports a "Repaired Records" warning on open.
Download
Type 2

Truncated File: Mid-Save Crash

The most common result of a crash during save. The file ends in the middle of a string entry, leaving unclosed tags.

Excel error message
Removed Part: /xl/sharedStrings.xml part with XML error. (Strings)
Unexpected end of input. Line 12, Column 18.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<sst count="18" uniqueCount="18">
  <si><t>Product</t></si>
  <si><t>Region</t></si>
  <si><t>Widget A</t></si>
  <si><t>Widget B</t></si>
  <si><t>Widget C</t></si>
  <si><t>Widget D</t></si>
  <si><t>Widget          <!-- ← CORRUPT: file ends here, mid-word -->

Fix, Option 1: If you can reconstruct the missing strings from the data, add them back and close all open tags.

Fix, Option 2: Delete all incomplete <si> entries, close the </sst> tag, and update count and uniqueCount to reflect only the complete entries. You'll lose values in cells that referenced the deleted entries, but the file will open.

<!-- Fixed with Option 2 - keeping only complete entries -->
<sst count="8" uniqueCount="8">
  <si><t>Product</t></si>
  <si><t>Region</t></si>
  <si><t>Widget A</t></si>
  <si><t>Widget B</t></si>
  <si><t>Widget C</t></si>
  <si><t>Widget D</t></si>
  <si><t>Widget E</t></si>
  <si><t>Widget F</t></si>
</sst>
📄
CORRUPT-sharedstrings-truncated.xlsx Corrupt Example
Simulates a mid-save crash - the file ends partway through a string entry, leaving unclosed tags. Excel reports an XML error with a line number.
Download
Type 3

Unescaped Special Characters

XML requires that certain characters inside tag content be escaped. The most common offenders are &, <, and >. When they appear unescaped, the XML parser cannot tell where a tag ends.

Excel error message
Removed Part: /xl/sharedStrings.xml part with XML error. (Strings)
<!-- CORRUPT: unescaped & and > -->
<si><t>Revenue > Costs</t></si>    <!-- ← > must be &gt; -->
<si><t>Price & Volume</t></si>     <!-- ← & must be &amp; -->
<!-- Fixed -->
<si><t>Revenue &gt; Costs</t></si>
<si><t>Price &amp; Volume</t></si>

Full escape reference:

Character Escaped form
& &amp;
< &lt;
> &gt;
" &quot;
' &apos;
📄
CORRUPT-sharedstrings-unescaped-chars.xlsx Corrupt Example
String entries contain bare & and > characters that should be escaped as &amp; and &gt;. Causes an XML parse error on open.
Download

Checklist: How to Check sharedStrings.xml in Your File

  • Rename your XLSX to .zip, navigate to the xl folder, copy sharedStrings.xml to your Desktop
  • Open in VS Code (with the Red Hat XML extension) and press Shift+Alt+F to format
  • Check the count and uniqueCount on the opening <sst> line
  • Scroll to the very end of the file - the last two lines should be </si> then </sst>
  • If VS Code shows red underlines anywhere, you have found the corruption
  • Use Ctrl+G to jump to a specific line if the Excel error message gave you a line number
The line number Excel reports is your starting point When Excel says "Unexpected end of input. Line 12, Column 18" - open the file in VS Code, press Ctrl+G, type 12, and jump straight to the problem.