Back to Secret Codes

Symbol encoding · Variable-length codes

Morse Code

Tap out letters in dots and dashes. The original digital protocol.

Morse is binary in disguise: every letter is a sequence of two symbols (dot, dash) plus timed gaps. The frequent letters get the shortest codes — E is a single dot — which is the same idea Huffman coding uses, 130 years later, to compress every JPEG and ZIP file you've opened.

What’s happening under the hood

  • Two symbols per letter, variable length per letter — a prefix code (no letter's encoding is the prefix of another's).
  • Letter frequency drove the length assignments. Samuel Morse counted type cases in a printer to find common English letters.
  • Huffman (1952) generalized this idea into the optimal-prefix-code algorithm at the heart of every modern compression format.

Dig deeper

Phase 0 · How Computers Think

The concept you just explored is taught with full depth in the formal DURA curriculum.