Audio Steganography

Hide secret messages inside music using LSB encoding - invisible to ears, readable by code.

Encode - hide a message
no notes - a random melody will be used
8 seconds - fits up to ~4,400 characters
Decode - reveal a message

Drop a WAV file here
or click to browse

Hidden message
How LSB steganography works
01

Generate audio samples

A melody is synthesised using the Web Audio API. Each note is a sine wave at a specific frequency. The audio is rendered into a flat array of 16-bit PCM integers: one number per sample, 44,100 samples per second.

02

Convert message to binary

Each character in the secret message is converted to its ASCII code, then to 8 binary digits. "H" → 72 → 01001000. The full message becomes a long string of 0s and 1s.

03

Write length header

The first 32 audio samples store the message length in binary. This tells the decoder exactly how many bits to read. Without this, the decoder wouldn't know where the message ends.

04

Flip the LSBs

For each bit of the message, take one audio sample and force its last bit to match. If the bit is 1: sample | 1. If 0: sample & ~1. This changes the sample by at most 1 unit out of 32,767 which is completely inaudible.

05

Export as WAV

The modified samples are packed into a WAV file (uncompressed). WAV preserves every sample exactly, unlike MP3, which would destroy the LSB data during lossy compression.

06

Decode

Load the WAV, read the first 32 sample LSBs to get message length, then read that many LSBs from subsequent samples. Group into 8-bit chunks, convert each to ASCII, and reconstruct the original text.