Skip to content
/file-formats/plink

PLINK (bed/bim/fam)

A three-file binary genotype format — .bed for packed two-bit calls, .bim for variant annotations, .fam for samples — that stores biallelic genotypes about 32x more compactly than VCF and is the input format for most association and population-genetics tools.

PLINK’s bed/bim/fam trio is a binary genotype matrix split across three files: a packed .bed holding two bits per genotype call, a tab-delimited .bim describing the variants (rows), and a .fam describing the samples (columns). All three share a stem, so mydata.bed is meaningless without mydata.bim and mydata.fam beside it.

How it works

The .bed file starts with three magic bytes: 0x6c 0x1b 0x01. The third byte is the mode. 0x01 means variant-major (all samples for variant 1, then all samples for variant 2), which is what PLINK 1.9 and 2.0 write. 0x00 means sample-major, which you will only see from very old files. After the header, genotypes are packed two bits each, four per byte, low bits first:

  • 00 = homozygous for the first allele (A1, column 5 of the .bim)
  • 01 = missing
  • 10 = heterozygous
  • 11 = homozygous for the second allele (A2, column 6)

Each variant’s block is padded to a whole byte, so a cohort of N samples takes ceil(N/4) bytes per variant. Total size is roughly 3 + M * ceil(N/4) bytes for M variants. One million variants across 2,000 samples is about 500 MB. The same data as an uncompressed VCF is tens of gigabytes.

The .bim has six columns, no header, one row per variant, in the same order as the .bed blocks: chromosome, variant ID, genetic position in centimorgans (usually 0), base-pair coordinate, allele 1, allele 2. Allele 1 is conventionally the minor allele as counted in the file that produced it, which is the source of most sign errors downstream.

The .fam has six columns, one row per sample, in the same order as samples are packed inside each variant block: family ID (FID), within-family ID (IID), paternal IID, maternal IID, sex (1 male, 2 female, 0/-9 unknown), and phenotype (1 control, 2 case, -9 missing, or a quantitative value). For an unrelated individual, FID and IID are commonly set to the same string, and the parent columns to 0.

This layout is the substrate for most of the quality-control pipeline: missingness, Hardy-Weinberg filtering, heterozygosity outliers, and relatedness checks all run on it before any association test 1. It is also the input format assumed by imputation prep scripts, HLA imputation on SNP panels 2, and GWAS pipelines generally 3.

In your own data

If your profile gave you a joint-called or single-sample VCF, the conversion you want is PLINK 2:

plink2 --vcf sample.vcf.gz \
  --max-alleles 2 --snps-only just-acgt \
  --set-all-var-ids '@:#:$r:$a' --new-id-max-allele-len 60 missing \
  --double-id --make-bed --out sample

Things to check immediately after:

  • wc -l sample.bim versus the variant count in your VCF. A large drop is expected if you had multi-allelic sites or indels, and --max-alleles 2 silently removed them.
  • Whether your VCF had genotypes as 0/1 or phased 0|1. PLINK discards phase entirely. If you need haplotypes, keep the VCF.
  • Variant IDs. A VCF with . in the ID column produces a .bim full of ., which breaks every merge and every --extract you try later. Set explicit IDs as above.
  • Chromosome naming. chr1 versus 1 will silently fail to match your reference panel or your score file. PLINK 2 writes what it reads unless you pass --output-chr 26 or --output-chr chrM.

Going the other direction is plink2 --bfile sample --recode vcf --out sample (PLINK 1.9 uses --recode vcf-iid). The round trip is lossy: you lose read depth, genotype quality, phase, and every INFO field. Format-conversion tools exist precisely because these round trips lose information in ways that break downstream analyses 4.

The default A1 assignment is the biggest practical trap. PLINK 1.9 sets A1 to the minor allele in your sample, which for a single person is meaningless. Use --ref-allele or PLINK 2’s --ref-from-fa with your reference FASTA so that A2 is the actual reference base. Polygenic scores computed against the wrong effect allele are wrong by sign, not by a small margin.

Limitations

The format encodes biallelic SNPs and nothing else. Indels are representable only if you encode them as two arbitrary allele strings, and structural variants have no representation at all, so any SV-based analysis needs a different container 5. There is no dosage field in bed/bim/fam, so imputed genotypes lose their uncertainty when you hard-call them, which matters most for low-frequency variants and admixed samples where imputation accuracy varies 6. PLINK 2’s .pgen/.pvar/.psam fixes the dosage and multi-allelic gaps and is what we use for new work, but many tools still expect the older trio, so the conversion is a standing tax.

Nothing here is a clinical result. Genotype calls from a research pipeline are not a diagnostic test, and any variant you want to act on needs confirmation in a clinical laboratory and interpretation with a genetic counselor or physician.

Woolf Software builds longitudinal molecular profiles of individuals: whole-genome sequencing, RNA sequencing, proteomics, blood biomarkers, and continuous glucose data, integrated into one model of you. Build your profile.

Computational Angle

If you have your own whole-genome VCF, converting a filtered subset to bed/bim/fam is what makes tools like PLINK, GCTA, KING, and most polygenic score software usable on it. The conversion is lossy in specific ways you need to know about before you run it.

Related Terms

References

  1. Ciara Coleman, Emma M. Quinn, Ross McManus. Quality Control Procedures for High-Throughput Genetic Association Studies . Methods in Molecular Biology, 2015. DOI
  2. Xiuwen Zheng. Imputation-Based HLA Typing with SNPs in GWAS Studies . Methods in Molecular Biology, 2018. DOI
  3. Jamil Momand, Eliot Bush. Genome Wide Association Studies (GWAS) . Concepts in Bioinformatics and Genomics, 2025. DOI
  4. Nab Raj Roshyara, Markus Scholz. fcGENE: A Versatile Tool for Processing and Transforming SNP Datasets . PLoS ONE, 2014. DOI
  5. Michal Sadowski, Agnieszka Kraft, Przemyslaw Szalaj, et al.. Spatial chromatin architecture alteration by structural variations in human genomes at the population scale . Genome Biology, 2019. DOI
  6. Haiko Schurz, Stephanie J. Müller, Paul David van Helden, et al.. Evaluating the Accuracy of Imputation Methods in a Five-Way Admixed Population . Frontiers in Genetics, 2019. DOI