How Does Google Hum to Search Identify Songs?

Google's Hum to Search feature identifies songs from a user's humming, whistling, or singing by converting the audio into a numerical sequence that represents the song's melody. Instead of matching exact pitch, lyrics, or studio-quality instrumentation, the system uses machine learning models to capture the underlying musical contour and compare it against a massive database of known song melodies.

Turning Audio into a Melody Fingerprint

When you hum into the Google Search mobile app, the audio is first processed to strip away irrelevant details such as background noise, vocal timbre, and the specific key you are humming in. A person might hum a tune an octave lower than the original recording or slightly off-key, so the model focuses on relative pitch changes and rhythm rather than absolute frequencies.

The core of the system is a deep neural network trained to generate a compact mathematical representation—often called an embedding—of the melody. You can think of this embedding as a melody fingerprint. Because the model is trained on pairs of audio clips (such as a studio recording alongside someone humming or singing the same tune), it learns to place both versions close together in a high-dimensional vector space.

Matching Against the Song Database

Once your hummed clip is converted into an embedding, Google compares it against millions of pre-computed embeddings from existing songs. To do this efficiently at scale, the system uses approximate nearest-neighbor search, which quickly narrows down the candidates to the songs whose melody contours most closely resemble your input.

In practice, the distance between your hummed query vector \(\mathbf{q}\) and a candidate song vector \(\mathbf{s}\) is measured using similarity metrics such as cosine similarity or Euclidean distance. The app then ranks the closest matches and presents the most likely songs along with a confidence percentage.

Why Hum to Search Works Without Lyrics

Traditional audio-fingerprinting tools, like those used when a song is playing over a speaker, rely on exact spectral peaks in the original recording. Those methods fail when a human hums because a voice lacks the percussion, harmony, and exact frequencies of the studio track. By training separate encoders for human-hummed audio and studio recordings to map into the same shared embedding space, Hum to Search bridges the gap between a rough vocal melody and a produced track.

This approach also explains why you only need to hum for about 10 to 15 seconds. That short window is enough for the neural network to extract a distinctive sequence of intervals and rhythmic patterns, allowing Google Search to pinpoint the song even if you cannot remember a single word of the lyrics.