How-To · 8 min read · Updated 2026-04-24

How to Recover a Corrupted or Broken GEDCOM File

A GEDCOM that won\u2019t load can feel catastrophic. Most "corrupted" files are actually salvageable with a few targeted fixes. Here is the diagnostic workflow.

First: don\u2019t panic, and don\u2019t overwrite

If your GEDCOM won't open, the worst thing you can do is keep trying to load and re-save it in software that may strip data. Before any repair attempt:

  1. Make a backup copy of the broken .ged file — name it \tree-broken-original.ged\ and store it somewhere safe
  2. Stop using the source software until you understand what's wrong
  3. Check for an autosave — many genealogy programs keep recent backups in a hidden folder
  4. Check cloud sync history — Dropbox, Google Drive, and OneDrive keep older versions of files for at least 30 days

A file that won't open today often opens fine after a small text-level fix. Don't lose the original to a panicked re-save.

Diagnose what kind of "broken" you have

"Corrupted" usually means one of these:

  • Won't load at all — software shows an error and refuses to open the file
  • Loads partially — some individuals appear, others vanish
  • Loads with garbled text — names and places appear as boxes or random characters (this is an encoding issue, not corruption — see our character encoding guide)
  • Loads but with broken family links — children appear without parents, spouses are unconnected
  • Loads but is missing recent edits — the file is intact but stale

Each symptom points to a different fix.

Inspect the file in a plain text editor

A GEDCOM is plain text. Open it in Notepad++ (Windows), BBEdit or TextEdit (Mac), or VS Code (any platform). Look for:

Valid header: The file should start with:

\\\ 0 HEAD 1 SOUR <SoftwareName> 1 GEDC 2 VERS 5.5.1 1 CHAR UTF-8 \\\

If the header is missing or malformed, no software will open the file. You can usually paste a generic header at the top to get past this.

Valid trailer: The file must end with:

\\\ 0 TRLR \\\

A missing TRLR line is the single most common cause of "file won't open" errors. Add it manually and save.

Level numbering: Every line starts with a number (0, 1, 2, 3...). A line that breaks the hierarchy (e.g. jumps from 1 to 3) confuses parsers. Look for lines without a leading number — these are usually corruption.

Fix 1: Repair header and trailer

If the header is missing, paste this at the top of the file (replace the SOUR line with your software name):

\\\ 0 HEAD 1 SOUR Recovery 1 GEDC 2 VERS 5.5.1 2 FORM LINEAGE-LINKED 1 CHAR UTF-8 \\\

If the trailer is missing, add this at the very bottom:

\\\ 0 TRLR \\\

Save the file with UTF-8 encoding (your text editor will have an option for this) and try loading it again.

Fix 2: Strip invalid lines

If your editor supports regular expressions, you can identify malformed lines:

  • Search regex \^[^0-9]\ to find lines that don't start with a digit — these are usually corruption and can be deleted
  • Search regex \^[0-9]+ @[^@]+@\\s*$\ to find empty record stubs that some tools choke on — these can usually be deleted safely
  • Search for null bytes (\\\0\) — these indicate the file was truncated mid-write

Delete the bad lines, save, and re-test. Make a copy first so you can compare before and after.

Fix 3: Use a validator

Several free GEDCOM validators will report exactly what's wrong with the file. Most genealogy programs also offer verbose import logs that list which records were skipped and why.

Use the validator's line numbers to navigate to the problem in your text editor and fix the specific issue.

Fix 4: Round-trip through a forgiving importer

When all else fails, a forgiving open-source GEDCOM importer is your best bet. Many "broken" files load fine in tolerant tools even when other software refuses them.

  1. Install a free, open-source genealogy program known for permissive GEDCOM import
  2. Create a new family tree
  3. Import your broken .ged — accept any prompts and ignore non-fatal warnings
  4. Once imported, immediately Export as GEDCOM (UTF-8, version 5.5.1)
  5. The exported file is usually clean and will open in any other software

This "round-trip" recovery rescues more files than any other technique.

Verify the recovery worked

Once you have a file that opens, upload it to GEDminer and check:

  • Individual count: Compare against your last known good count, if you have one
  • Family count: Same
  • Date range: Earliest and latest birth years should match what you remember
  • Tree connectivity: A sudden drop in connectivity means broken family links during recovery
  • Error report: Run Integrity > Errors and review every flagged record manually — recovered files often have edge cases the parser tolerated but that need fixing

If the counts are dramatically lower than expected, some records didn't survive the recovery. Try a different repair tool or reach out to a genealogy forum with the original broken file (with personal data redacted).

How to prevent this happening again

Once you've recovered, set up a backup routine so you never have to do this again:

  • Export a fresh GEDCOM weekly — automate it if your software supports it
  • Store backups in three places: local drive, external drive, cloud
  • Use versioned filenames: \tree-2026-04-24.ged\ rather than overwriting \tree.ged\ each time
  • Test backups occasionally by loading them into GEDminer and checking the counts
  • Keep older backups indefinitely — disk space is cheap; rebuilding 20 years of research is not

A five-minute weekly habit prevents most genealogy data disasters.

Tags: corrupted GEDCOM, repair GEDCOM file, broken GEDCOM, GEDCOM won\u2019t open, fix GEDCOM syntax, recover family tree, GEDCOM validation, salvage GEDCOM