Pangrammatic Window Finder

Find the shortest substring of text that contains all 26 letters.

Open tool

Overview

A pangrammatic window is the shortest contiguous substring of a longer text that still contains every letter of the alphabet. Give the finder a passage and it scans for the minimum-length window where all 26 letters appear, returning both the window and its length.

Linguists analyzing the density of English text, students learning sliding-window algorithms, and writers attempting "compressed" pangrams in published prose all benefit. It's a fun way to evaluate how diverse the vocabulary of a paragraph is — short windows usually appear only when the writing is unusually varied.

How it works

The algorithm uses the classic two-pointer sliding-window technique. Two indices walk through the text. The right pointer expands until the window contains all 26 letters; the left pointer then contracts as far as possible without losing any letter. The smallest window seen during this walk is the answer. With careful counting, the algorithm runs in linear time.

Examples

Input:  ...long passage of English prose...
Window found (487 chars): "Mrs. Quickly, vexing with deft Jab and fly..."
Length: 487 characters
Input:  The quick brown fox jumps over the lazy dog. Hello world.
Window: The quick brown fox jumps over the lazy dog
Length: 43 characters

FAQ

What's the shortest pangrammatic window known in published English?

A famous example from "The New York Times" archives has been measured at around 36–40 letters. Shorter windows almost always come from text that was deliberately constructed.

Does case matter?

No. Letters are folded to a single case for the window check, since pangrams are defined on the 26-letter alphabet.

What if my text doesn't contain all 26 letters?

The tool reports "no pangrammatic window found" and lists which letters are missing.

Try Pangrammatic Window Finder

An unhandled error has occurred. Reload ×