SamTools

View and analyze alignment files using samtools

SAM/BAM Viewer

View and analyze alignment files using samtools

Loading WebAssembly runtime...

About the SAM/BAM Viewer

The SAM/BAM Viewer runs samtools 1.10 as a WebAssembly build directly in your browser. You get the same header parsing, alignment statistics and record inspection you would get from the command line, without installing anything or uploading a file to a server.

A SAM or BAM file records how a sequencing read aligns to a reference genome: the reference name, position, mapping quality, CIGAR string, sequence and quality string for every read. Reading the header tells you how the file was produced and which reference it is against; the flagstat summary tells you how many reads mapped, paired, secondary or supplementary. Together they are the first sanity check you run on any new alignment.

Because the tool runs client-side, it is safe for confidential data. Clinical, embargoed and unpublished alignments can be inspected without transferring a single byte off your machine.

What this tool does

Read alignment headers

Inspect @HD, @SQ and @RG records to confirm the reference build, contig lengths, sort order and read groups before you trust any downstream result.

Alignment statistics

flagstat counts total, primary, secondary, supplementary, paired, properly paired and duplicate reads, giving an immediate read on mapping success and duplication.

Record inspection

Dump individual alignments to read CHROM, POS, MAPQ, CIGAR, RNAME and the read sequence for spot-checking a suspicious region.

Works with compressed input

Accepts .sam, .bam and .bam.gz uploads, so you can inspect the exact delivery you received from a sequencing provider.

Example commands

samtools view -H

Print the alignment header only. Run this first to verify the reference build and contig definitions.

samtools flagstat

Summarise total, mapped, paired, properly paired and duplicate read counts in one pass.

samtools view -c

Count alignment records without printing them, useful for a quick size check on a large file.

samtools view

Stream the full alignment content to inspect individual records at a position of interest.

Frequently asked questions

Are my alignment files uploaded to a server?

No. samtools is compiled to WebAssembly and runs inside your browser tab. The file is read into browser memory and processed locally, so it is never transmitted or stored anywhere.

Which samtools version is this page running?

The WebAssembly build is samtools 1.10, which is the long-standing stable release and matches what most published pipelines reference.

What is the difference between primary, secondary and supplementary alignments?

A primary alignment is the best placement of a read. Secondary alignments are additional plausible placements reported for multi-mapping reads. Supplementary alignments record a part of a read whose split alignment could not be represented on a single line.

What does a low properly-paired percentage mean?

It usually points to library preparation problems: adapter contamination, insufficient insert size, over-trimming that broke fragment integrity, or a reference that does not match the library. Check duplicate rate and insert size at the same time to narrow it down.

Can I convert a BAM file to SAM with this tool?

This page focuses on inspection. For format conversion, index sorting and larger file handling, use the dedicated tools such as the FASTA/FASTQ page or the sequence file converter.

How large a file can I open?

It depends on your device memory, because the whole file is loaded into browser memory. Files of a few hundred megabytes are generally fine on a modern laptop. For very large whole-genome alignments, a local samtools install is the better choice.

Related tools

All processing happens locally in your browser. Nothing you upload is transmitted or stored, as described in the privacy policy.