Understanding the inside of a GEDCOM is not required to use one. But once seen, a lot of things stop being mysterious: why photos are missing, why two programs show slightly different things, why a file broke. Here is the whole grammar in one sitting.
Lines
Every line has a level number, then a tag, then usually a value.
0 @I1@ INDI
1 NAME John /Smith/
1 SEX M
1 BIRT
2 DATE 14 MAR 1892
2 PLAC Boston, Massachusetts
Level 0 starts a record. Level 1 is inside that record. Level 2 is inside the level 1 line above it. So: a person (INDI) has a name, a sex, and a birth; the birth has a date and a place. Indentation is not used; the numbers do the nesting.
Slashes around the surname in NAME mark which part is the family name.
Records and their IDs
@I1@ is a cross-reference identifier. Every record gets one, and other records point at it. I for individuals, F for families, S for sources, R for repositories, N for notes, O for media objects, by convention.
The main record types:
INDI. A person.FAM. A family: a couple and their children. A person appears in oneFAMas a child (FAMC) and in one or more as a spouse (FAMS).SOUR. A source.REPO. A repository.OBJE. A media object: a reference to a photo or document by file path.NOTE. A note, when shared between records.SUBM. The submitter (who made the file).HEADandTRLR. The header at the top and the one-line trailer at the bottom.
How families link
0 @I1@ INDI
1 NAME John /Smith/
1 FAMS @F1@
0 @I2@ INDI
1 NAME Mary /Jones/
1 FAMS @F1@
0 @I3@ INDI
1 NAME Ann /Smith/
1 FAMC @F1@
0 @F1@ FAM
1 HUSB @I1@
1 WIFE @I2@
1 CHIL @I3@
1 MARR
2 DATE 1915
John and Mary are spouses in family F1; Ann is a child of F1. That is the entire relationship model. Everything a viewer draws is derived from those links.
How sources link
1 BIRT
2 DATE 14 MAR 1892
2 SOUR @S1@
3 PAGE p. 14, line 3
3 QUAY 3
0 @S1@ SOUR
1 TITL 1900 United States Federal Census
1 REPO @R1@
2 CALN T623
0 @R1@ REPO
1 NAME National Archives
The birth cites source S1 at a page, with a quality rating. S1 is held at repository R1 under a call number.
Media
1 OBJE
2 FILE C:\Users\Jane\Media\smith.jpg
2 FORM jpg
2 TITL John Smith, 1892
A path and a title. Not the image. This is why photos do not travel.
Long text
In 5.5.1, text longer than a line is continued with CONC (join without a space) and CONT (start a new line). GEDCOM 7 dropped CONC.
1 NOTE This note is quite long and
2 CONC continues on the next line without a break,
2 CONT and then starts a new paragraph.
The header
0 HEAD
1 SOUR RootsMagic
2 VERS 9.0
1 GEDC
2 VERS 5.5.1
1 CHAR UTF-8
Which program made the file, which version of the standard, and which character encoding. If a file is misbehaving, this is the first place to look.
That is it
Levels, tags, values, and pointers between records. Everything else is vocabulary. Anyone who can read the samples above can read their own file. GED-VIEW's raw GEDCOM Editor shows the same lines with numbering, for those who want to look without leaving the app.
Next
Open a file, find yourself, and follow the FAMC pointer to your parents' family. Then find them.