LSB Extractor
Extract hidden LSB data from PNG/BMP images. Reads the LSBSTEG header automatically, or scans 10 common settings when there is none. Manual bit depth and channels, bit plane viewer, flag detection.
Try the demo instantly
Loads a 200×200 gradient PNG — no upload needed
Drop image file or click to browse
PNG, BMP, WebP, JPEG — max 50 MB (10 MB on mobile). TIFF opens only in browsers that can decode it (Safari)
Processed in your browser
Your image is decoded in your browser, in a Web Worker, and is not sent to a StegoToolkit server. Basic usage analytics record coarse facts such as file type and size range, never the image or your payload. Output is always a lossless PNG.
How to Extract LSB Hidden Data from an Image (4 steps)
- Upload the PNG, BMP or WebP that may hold hidden LSB data. The tool reads the first 54 pixels for an LSBSTEG header; a green card shows the recorded settings when a valid header is found.
- Quick mode extracts automatically: with a header it uses the recorded settings, without one it runs the ranked scan over 10 common settings. Standard adds Manual (your bit depth, channels and byte packing) and a forced Ranked Scan. Enter the password if the payload was encrypted.
- Forensic mode adds the bit plane viewer (R, G, B × 8 bits = 24 planes, each with the binary entropy of its share of 1s) and a per-channel LSB entropy summary, so you can look for a plane that shows text or a pattern.
- Read the extracted text or download the payload. A JSON report of the extraction is available whether or not anything was found.
Prefer automated detection? Try our Zsteg tool to scan all bit planes and filters at once instead of checking them by hand.
LSB Extractor — Detection & Extraction Methods
| Method | Technique | Needs | Best For |
|---|---|---|---|
| Auto (LSBSTEG header) | Reads the 20-byte header from the first 54 pixels and uses the recorded variant, bit depth and channels; trusted only if its CRC-32 matches and the stored length fits the image | An image made by the LSB Embedder | Exact settings, decryption and decompression handled for you |
| Ranked Scan (10 settings) | No header assumed: reads 512 bytes with each of 10 common settings from the first pixel, scores them, and shows the best 3. Counts as found only with a file signature, a flag, or at least 10 readable characters from the start | Nothing, but it cannot read encrypted data or messages under 10 characters | Images from other tools or CTF challenges that use a common layout |
| Manual | Your bit depth, channels and byte packing. With a header they replace the recorded values; without one, reading starts at pixel 0, left to right, top to bottom | The settings used when hiding | When you know the layout, or the ranked scan found nothing |
| Bit Plane Viewer (Forensic) | Draws the 24 planes (R, G, B × bits 0–7) and the binary entropy of the share of 1s in each | Nothing | Looking for a plane that shows text, a pattern or noise where its neighbours are smooth |
How LSB Extraction Works
An LSB decoder (extractor) reverses LSB hiding. Hiding with the least-significant-bit method overwrites the lowest bit (or lowest few bits) of colour values with message bits. Extraction reads those same bits back in the same order and packs them into bytes. To do that it must know the bit depth (how many low bits per value), the channels (R, G, B, sometimes A), the pixel order (raster order, or a shuffled order), and how the bits were packed into bytes. An image made by this site's LSB Embedder carries a 20-byte header that records most of that; an image from anywhere else does not, so the Extractor has to be told or has to try common settings.
The tool decodes your image in a Web Worker and reads its raw RGBA pixels. A browser canvas cannot hand back exact colour values for transparent or partly transparent pixels, so bits stored under transparency may not be readable here. Everything is read from the image as saved: a JPEG copy of the image no longer holds LSB data, because JPEG rewrites every pixel.
Reading LSB Bits by Hand (CTF walkthrough)
Take the red, green and blue values of the first pixels in raster order and keep only the lowest bit of each. Pixels (200, 101, 50), (200, 100, 50) and (202, 103, 52) give 0, 1, 0, 0, 0, 0, 0, 1 (from the first eight values). Group eight bits per byte, most significant bit first: 01000001 is 65, the letter A. That is Ranked Scan setting 1 (RGB, 1-bit, MSB-first). If the output is gibberish, change one thing at a time: pack the bits LSB-first instead (zsteg calls this 'lsb'; the same eight bits would read 10000010 = 130), use a single channel (settings 3-5), two bits per value (settings 6 and 10), include Alpha (setting 7), or start from the last pixel (setting 9). In zsteg's naming, 'b1,rgb,msb,xy' is setting 1 and 'b1,rgb,lsb,xy' is setting 2; we checked the 1-bit layouts against images we built, not against the zsteg program.
The LSBSTEG Header and Auto Mode
The Embedder writes a 20-byte header in pixels 0–53, 1 bit per R, G, B: magic 'LSTG', version, variant (sequential, PRNG or Blue channel), channel bitmask, bit depth, encryption flag, compression flag, stored length (4 bytes, little endian) and a CRC-32 of the first 16 bytes. The Extractor trusts the header only when the CRC matches and the stored length fits the image at the recorded settings. The CRC-32 is an integrity check against accidental change, not authentication: anyone can write a header with a valid CRC. The header is also rejected when its version is not 1, its variant is not 0–2, its bit depth is not 1–4, a flag is not 0 or 1, or its channel mask is empty. A bad CRC is reported as such, and a random image almost never passes: 32 bits of magic plus a 32-bit CRC.
With a valid header the payload is read, decrypted if the flag says so (a missing password and a wrong password are reported separately), inflated if the compression flag is set (a failure is reported, not hidden), and then classified. For PRNG images the pixel order is rebuilt from the password (seed 0 when none was used), so the same password is needed for the pixel positions as well as for decryption.
The Ranked Scan for Images Without a Header
The ranked scan tries these 10 settings, each from the first pixel: 1. RGB 1-bit MSB-first; 2. RGB 1-bit LSB-first; 3. B 1-bit MSB-first; 4. R 1-bit MSB-first; 5. G 1-bit MSB-first; 6. RGB 2-bit MSB-first; 7. RGBA 1-bit MSB-first; 8. RB 1-bit MSB-first; 9. RGB 1-bit MSB-first from the last pixel backwards; 10. RGB 2-bit LSB-first. 'LSB-first' means the first extracted bit becomes bit 0 of the byte, as in zsteg's 'lsb' order. It reads the first 512 bytes per setting; if they start with a plausible little-endian length it returns that block, otherwise the leading readable text or the first 256 bytes.
A reading counts as found only with evidence: a file signature (PNG, JPEG, GIF, ZIP, PDF, MP3 with ID3, WAV, ELF, MP4), flag-shaped text, or at least 10 readable characters from the start. Anything else is shown as 'weak candidates' because ten random-looking readings always produce a highest score. In our tests none of the unmodified images we tried was reported as found: synthetic photo-like and flat images, and 8 crops of a real photograph. The scan cannot see messages shorter than 10 characters, encrypted data without a header (it looks like noise), other bit depths or channel mixes, shuffled pixel orders, or data stored in a different file format or in other bits of the file. Layouts were verified with images we built to the same layout, not with the zsteg or stegolsb programs themselves.
Reading the Result
Payload type is decided from the extracted bytes: a full file signature gives a file type; otherwise well-formed UTF-8 made of printable characters (accents, CJK and emoji included) is text; everything else is binary. A short 'GIF…' or 'PK…' text is not mistaken for a file because the full signature (GIF8, PK\x03\x04) is required. The name of a hidden file is not stored by the Embedder, so the download is named after the detected type.
Flag detection scans decoded text for FLAG{…}, CTF{…}, HTB{…}, picoCTF{…}, THM{…} and any 2–8 capital letters followed by braces, plus bare hexadecimal strings of 32 or more characters (hash-style flags). The match must be printable ASCII, so noise does not produce flags. A match is a pattern, not proof that it is the challenge's flag.
When LSB Extraction Fails
Work down this list in order. (1) Is the file still the original? A JPEG conversion recovered 0 of 8 messages in our tests, while PNG, BMP and TIFF copies kept all 8; if you only have a re-saved or resized copy, the bits are gone. (2) Is there an LSBSTEG header? The green card on the settings step says so. With a header the settings are exact, so a failure there is a password, compression or damage problem, each reported separately. (3) No header: try Manual mode with the bit depth, channels and byte packing you expect, including LSB first. The ranked scan only covers 10 settings and cannot see messages under 10 characters. (4) Look at the bit planes in Forensic mode for a low plane that shows text or a pattern. (5) If the image shows no sign of LSB data, the message may be elsewhere: in metadata, after the end of the file, or in a frequency-domain method — try the Steganography Detector, the Zsteg tool or the Image Steganography Extractor.
Bit Planes and What They Show
Each of R, G and B holds 8 bit planes, from bit 7 (most significant, the picture's shape) down to bit 0 (least significant). The viewer draws all 24 as black-and-white images and prints the binary entropy of its share of 1s (1.0 when exactly half the values have the bit set, about 0.5 when 11% or 89% do, 0 when all agree; planes below 0.5 are outlined). The number ignores where the 1s are, so a noisy plane and a striped plane with the same share score the same. Large images are shown at reduced size, sampled by nearest neighbour; the statistics are computed on the same sampled image.
Higher bit planes often show the picture's broad structure, while lower planes hold fine detail, noise or hidden patterns; how one-sided a plane is depends on the image (flat graphics and screenshots can have one-sided low planes with nothing hidden). Neither a plane's entropy nor its appearance proves that data is hidden. What to look for is a low plane that looks like noise, text or a regular pattern while the planes next to it look smooth. A random payload that fills a region pushes that region's LSB value toward 1.0. Alpha planes are not shown.
LSBSTEG Header Layout (20 bytes)
Embedded 1 bit per R, G, B in pixels 0–53; the payload starts at pixel 54.
| Bytes | Field | Values |
|---|---|---|
| 0–3 | Magic | 'LSTG' |
| 4 | Version | 1 |
| 5 | Variant | 0 sequential, 1 PRNG, 2 Blue channel |
| 6 | Channels | bitmask: R 1, G 2, B 4, A 8 |
| 7 | Bit depth | 1–4 |
| 8 | Encrypted | 0 or 1 (AES-256-GCM) |
| 9, 11 | Reserved | 0 |
| 10 | Compressed | 0 or 1 (deflate) |
| 12–15 | Stored length | bytes of payload, little endian |
| 16–19 | CRC-32 | of bytes 0–15, little endian |
Does the Hidden Data Survive a Conversion? (our test)
A 600-byte message hidden with the LSB Embedder (1-bit Sequential R + G + B) in 8 crops of 800 × 600 from one photograph, converted with the macOS system image tool (sips), then read by the Extractor. Other encoders, resizing and individual websites or apps were not tested.
| Conversion | Message recovered |
|---|---|
| PNG → PNG | 8 of 8 |
| PNG → BMP → PNG | 8 of 8 |
| PNG → TIFF → PNG | 8 of 8 |
| PNG → JPEG quality 100 → PNG | 0 of 8 |
| PNG → JPEG quality 95 → PNG | 0 of 8 |
| PNG → JPEG quality 75 → PNG | 0 of 8 |
Examples
Input: A PNG made with the LSB Embedder: sequential, 1-bit RGB, message 'Hi there, this is the secret.'
Result: Header found (sequential · 1-bit · RGB · payload 29 bytes). Extracted text: 'Hi there, this is the secret.', type text.
Meaning: The recorded settings were used, so nothing had to be guessed.
Input: A PNG with no header where setting 1 (RGB, 1-bit, MSB-first) hides 'flag{lsb_is_easy}' from the first pixel, followed by ordinary image noise
Result: Ranked scan: the best candidate starts with 'flag{lsb_is_easy}' and the flag banner shows it.
Meaning: At least 10 readable characters from the start, and a flag shape, count as found.
Input: An ordinary photograph with nothing hidden
Result: 'No clear hidden data found — weak candidates only', with the three top-scoring readings, which are noise.
Meaning: Ten settings always produce a best score; the tool does not call it a find without a file signature, a flag or readable text.
Input: An encrypted LSBSTEG image and the wrong password
Result: 'Wrong passphrase' — no text and no download. With no password: 'Encrypted payload detected'.
Meaning: AES-GCM authentication fails for a wrong password; the tool never shows noise as if it were the message.
How the LSB Extractor Works
1. Decode the image
The browser decodes your file to raw RGBA pixels in a Web Worker. Nothing is uploaded.
2. Look for the header
The first 54 pixels are read 1 bit per R, G, B into 20 bytes; the magic, CRC-32 and stored length are checked.
3. Read the payload
With a header: the recorded variant, bit depth and channels (or your manual values). Without: your manual settings, or the 10-setting ranked scan.
4. Decrypt and decompress
If the header says so, the stored stream is decrypted with your password (AES-256-GCM) and inflated. Each failure is reported separately.
5. Classify
File signature, text, or binary; flag patterns; then the result, the candidates and a JSON report.
What the results mean
| Result | What it means | What to do |
|---|---|---|
| Header found, text shown | A valid LSBSTEG header was read and the payload decoded | Done — copy or download it |
| Encrypted payload detected | The header says the payload is AES-256-GCM encrypted and no password was given | Enter the password used when hiding and extract again |
| Wrong passphrase | Decryption failed authentication | Check the password; there is no way to recover a forgotten one |
| Header found, but the data could not be decompressed | The compression flag is set but inflating failed | The image was probably altered after hiding; try the original file |
| No clear hidden data found — weak candidates only | The ranked scan's best readings have no file signature, flag or readable start | Try Manual mode, the bit plane viewer, or the Steganography Detector; the data may be elsewhere or destroyed |
| Header found — CRC mismatch | The magic matched but the checksum did not, so some header bits changed | Use Manual mode; the image may have been edited |
Limitations
- Only LSB data in the pixel values of this image is read. Data in file metadata, appended bytes, other formats, or frequency-domain methods (DCT) is not.
- Images re-saved as JPEG, resized, or re-compressed by a service no longer hold the LSB data (JPEG conversion recovered 0 of 8 in our tests; other services untested).
- The ranked scan covers 10 settings and 512 bytes each. It cannot find messages under 10 characters, encrypted data without a header, shuffled pixel orders, or settings outside the list; use Manual for a known layout.
- Browser canvases cannot return exact colour values under transparent or partly transparent pixels, so bits stored there may be unreadable.
- Statistics in the bit plane viewer describe the picture, not intent: flat graphics have one-sided low planes without any hidden data.
- Nothing is detected without evidence: a very short or noise-like message can be missed even when it is present.
- Reading images made by the zsteg or stegolsb programs was checked with images we built to the same layout, not with those programs.
Privacy
Your image and password are processed in your browser, in a Web Worker, and are not sent to a StegoToolkit server by the tool's own code. The only things the tool keeps in your browser are your chosen mode (localStorage) and a flag that you dismissed the mobile tip (sessionStorage). Site analytics, if you accept them, may record coarse facts such as the bit depth you chose in Manual mode, the file type, a size range and timing — never the image, extracted data, password or file name. The hosting provider's ordinary request logs still record your visit.
Which Tool Next?
- LSB Embedder — Hide data with the layout this Extractor reads automatically
- Zsteg Online — Scans many more bit-plane, channel and order combinations at once
- StegSolve Online — Bit-plane viewer, filters and brute-force workspace
- Steganography Detector — Tests whether an image looks modified before you try to extract
- Image Steganography Extractor — For images made with Adaptive LSB, DCT or Spread Spectrum
Frequently Asked Questions
What is the LSBSTEG header and how does the extractor use it?
A 20-byte block in the first 54 pixels (1 bit per R, G, B) written by the LSB Embedder: magic 'LSTG', version, variant, channel bitmask, bit depth, encryption and compression flags, stored length and a CRC-32. If the CRC matches and the length fits the image, the Extractor uses the recorded settings exactly, so no guessing is needed.
My image has no LSTG header — what happens?
The ranked scan reads the image with 10 common settings (RGB, B, R, G, R+B, RGBA at 1 bit; RGB at 2 bits; LSB-first packing; reversed pixel order), scores them, and shows the top 3. It counts as a find only with a file signature, flag-shaped text, or at least 10 readable characters from the start; otherwise it says no clear data was found and shows the readings as weak candidates.
How do I use the bit plane viewer?
In Forensic mode open 'Bit Plane Analysis (24 planes)'. Each tile is one bit of one channel; the number is the binary entropy of the share of 1s (1.0 = exactly half the values have the bit set). Higher planes often show the picture's broad structure. Look for a low plane that looks like noise, text or a pattern next to smooth neighbours. Flat graphics can have one-sided low planes with nothing hidden, so a low value is a hint, not evidence.
What does 'Encrypted payload detected' mean?
The header's encryption flag is set, so the payload is AES-256-GCM encrypted and the Extractor needs the password used when hiding it. A wrong password gives 'Wrong passphrase', never noise.
The result looks like noise or nothing was found — what went wrong?
Common causes: the image was converted to JPEG, resized or re-compressed after hiding (JPEG conversion recovered 0 of 8 in our tests); different settings were used (try Manual); the message is shorter than 10 characters or encrypted without a header; the data is in a different layer such as metadata or appended bytes; or nothing was hidden.
Can this tool read other LSB tools' output?
Sometimes. The ranked scan covers common layouts such as 1-bit RGB in raster order, single channels and LSB-first packing, and Manual mode can set any bit depth, channels and byte packing from pixel 0. It cannot follow shuffled pixel orders from other tools or layouts with their own framing. We checked these layouts with images we built, not with the zsteg or stegolsb programs themselves. For a wider automatic scan see the Zsteg tool.
What flag patterns does it look for?
FLAG{…}, CTF{…}, HTB{…}, picoCTF{…}, THM{…}, any 2–8 capital letters followed by braces, and bare hexadecimal strings of 32 or more characters. Matches must be printable ASCII. They are patterns, not confirmation that the challenge accepts them.
Is my image uploaded to any server during extraction?
The tool's own code does not upload your image or password: extraction runs in a Web Worker in your browser. Accepted analytics may record coarse option choices, file type, size range and timing, but never the image, extracted data, password or file name, and your host's ordinary request logs still see the page visit.