Skip to content
Toolcroft

Image Steganography - Hide Text in an Image

Camera, Mic & Media

Hide a secret text message inside any PNG image using LSB steganography, or reveal hidden messages from an image. All processing runs locally in your browser.

How to use this tool

  1. Select the "Encode" tab and upload a PNG image.
  2. Type the message you want to hide, then click "Encode & Download".
  3. To reveal a hidden message, switch to the "Decode" tab and upload the encoded image.
  4. The hidden text appears in the output box.

How LSB steganography works

The message is converted to UTF-8 bytes, then to individual bits. Each bit is written into the least significant bit (LSB) of the red channel of successive pixels. A null byte (\x00) marks the end of the message. Because the change is only ±1 per pixel, the image looks identical to the human eye.

Important: use PNG only

JPEG compression averages nearby pixels together, which destroys the single-bit changes. Always use PNG (lossless) as both input and output to preserve the hidden message.

Privacy

All encoding and decoding runs on an HTML5 canvas in your browser. No images or text are sent to any server.

Steganography vs. cryptography

These two security techniques serve different goals and are often combined:

  • Cryptography makes the content of a message unreadable to anyone without the key. An observer can see that an encrypted message exists but cannot read it.
  • Steganography hides the existence of the message itself. A stego image looks like an ordinary photo - an observer has no reason to suspect a hidden message.

For strong privacy, combine both: encrypt your plaintext message first (e.g., with AES), then embed the ciphertext in the image. An attacker who discovers the steganography still cannot read the message without the encryption key.

Detection (steganalysis)

Steganography is not undetectable by determined analysis:

  • Visual comparison: comparing the original and stego images side-by-side at high zoom or adjusting brightness/contrast can reveal subtle pixel changes.
  • Statistical analysis (chi-square test): LSB steganography changes the statistical distribution of least-significant bits in a predictable way. A chi-square test on pixel values can detect when LSBs have been replaced with message data.
  • Histogram analysis: the pixel value histogram of a stego image shows characteristic "pairs" where adjacent values are equalized, which is detectable.

Capacity limits

Using 1 LSB per color channel per pixel (3 channels), a PNG image can store:

Capacity (bytes) = width × height × 3 / 8

A 1000 × 1000 pixel image can hold: 1000 × 1000 × 3 / 8 = 375,000 bytes ≈ 366 KB of hidden data. Larger messages require proportionally larger carrier images. Hiding very large messages in small images increases detectable artifact density.

Frequently asked questions

What is steganography?

Steganography is the practice of hiding a message within another file. This tool encodes text in the least significant bit (LSB) of each pixel's red channel, making the change imperceptible to the human eye.

Will the image look different after encoding?

No visible change is detectable. The LSB modification shifts each pixel value by at most 1 - far below the threshold of human perception.

Why must I use PNG?

JPEG compression discards the small bit-level changes used for steganography. PNG uses lossless compression, so the encoded bits survive the save/load cycle.

Is my image or message sent anywhere?

No. All encoding and decoding is performed locally on an HTML5 canvas in your browser.

Browse all camera, mic & media