Entropy / Chi-Square Analyzer
Analyze any file with Shannon entropy and chi-square statistics. Scan adjustable byte windows, list unusually random or repetitive ranges with window-boundary offsets, and open them in the Hex Viewer. Runs in your browser.
This tool measures Shannon entropy and chi-square over byte windows of any file and lists the ranges that look unusually random or repetitive. It does not identify what a range is. For statistical checks aimed at LSB steganography in images and WAV audio, see the Steganography Detector.
Drop any file here, paste it (Ctrl/⌘+V), or
Any file type · up to 200 MB · read in your browser, never uploaded
How to find where a file's bytes change (5 steps)
- Add the file: Drop any file, paste one, or choose it. There is no format restriction. The limit is 200 MB, or 50 MB on phones and on devices that report little memory or few processor cores. A scan that takes longer than 20 seconds is stopped. The file is read by a background worker in your browser and is never uploaded.
- Read the results: The scan starts at once with the defaults (4,096-byte windows, no overlap). The Results tab shows the whole-file numbers, an entropy chart with a chi-square strip under it, the flagged byte ranges with their window-boundary offsets, and a byte-frequency histogram.
- Zoom in on a range: Re-scan finer halves the window (never below 256 bytes) and, at 256 bytes, switches overlap on. Drag across the chart, or press Zoom to it, to look closer. Thresholds can be changed without scanning again.
- Open it in the Hex Viewer: Each flagged range has Open in Hex Viewer, which opens the Hex Viewer at that offset with the range highlighted. Export the results as JSON or CSV from the Results tab.
- Send the file on: Next steps suggests tools from what was found, each with a reason, and can hand the whole file or a flagged range to the tools that accept it. What you send stays in this browser for up to 30 minutes.
What Entropy and Chi-Square Tell You About a File
Shannon byte-frequency entropy measures the uncertainty implied by the distribution of byte values in a stretch of data. It ranges from 0 bits per byte (every byte has the same value) to 8 (all 256 byte values occur equally often). It does not measure every form of sequence predictability: a repeating pattern that uses all 256 values evenly still scores 8. English text sits well below 8 (4.33 for a 2.4 MB file of English words in our tests), executables vary widely (3.13 to 7.11 bits in the four real executables and boot images we measured), and compressed archives, compressed media data and encrypted data often sit close to 8 (uncompressed media can have much lower entropy). Chi-square compares how often each of the 256 byte values occurs with the counts a uniform-byte model expects. It is 0 when all 256 byte values have exactly equal counts, and becomes large when the observed counts differ substantially from that expectation, as in a file that repeats a few values.
A file that is half padding and half random-looking data can have an ordinary whole-file entropy, so a single number can hide the interesting part. This tool scans the file in windows, so it can show where the statistics change and give you the offsets. It does not say what the data is: compressed, encrypted and random data all look alike to these two measures, and a flagged range is a place to look, not a result.
How a Scan Works
The file is read in slices by a background worker and cut into windows. Window i starts at i × step, where step is the window size (or half of it with overlap on), and is as long as the window size or, for the last windows, whatever is left. A window shorter than the selected size is marked partial and is judged at its own size. For every window the tool counts the 256 byte values and computes the entropy H = −Σ p·log₂ p and the chi-square Σ (O − E)² / E with E = N / 256, where N is the window's byte count. The whole file gets the same two numbers plus its serial correlation (the linear correlation between adjacent byte values).
The default window is 4,096 bytes. The presets are 256, 512, 1,024, 4,096, 16,384 and 65,536 bytes, and any whole number from 256 to 65,536 can be typed. A smaller window gives finer offsets and noisier numbers; a larger one is steadier but coarser. Overlap moves the window by half its size, which doubles the number of windows and tightens where a boundary can fall.
How Ranges Are Flagged
Only entropy flags a window. A window at or above the high threshold is random-looking; one at or below the low threshold (2.0 bits by default) has a highly concentrated byte distribution and is labelled repetitive (low-entropy). The tool measures that property; it does not recognise what the data is. Chi-square is always shown next to the entropy, with the window's byte count, but it never creates a finding. The high threshold depends on the window size because a short window of truly random bytes cannot reach 8 bits: the calibrated defaults are in the table below, and any size between two presets gets a value interpolated between them, which is labelled as an estimate.
Consecutive full windows that cross the same threshold merge into a detected region (two or more windows). A single qualifying window with no qualifying neighbour is listed separately as an isolated anomaly, so one window of appended data is not lost. A final window shorter than the selected window size is never merged with its neighbours. It is judged using its actual byte count and, if it crosses a threshold, appears as a separate partial-window finding. A window under 256 bytes is shown but never classified. Each of the three lists (regions, isolated anomalies, partial-window findings) separately keeps its 200 most extreme entries, ranked by how far past the threshold they are and then shown in file order, and the chart still shows every window. Region boundaries are window edges, not exact bytes: re-scan finer to narrow them.
Entropy of Each Section in a PE or ELF Executable
When the file is a Windows PE or a Linux ELF executable, the tool also reads the section table the file declares and measures each section's own bytes: its name, its file range, its size, its flags (read, write, execute), its entropy and chi-square, with the section's byte count. A section is judged against the calibrated default for its own size (the 64 KB value for anything larger), moved by any change you made to the high threshold. Sections that have no bytes in the file (an ELF .bss, a PE section with a raw size of 0) are listed as such and are never given an entropy.
A random-looking executable section is commonly seen in packed or encrypted code, and a random-looking data section in compressed resources; the tool does not say which, and it does not say the file is packed or malicious. The section table is only read, not trusted: a table that points outside the file or is cut off is reported with a note, and any character in a section name that is not printable ASCII is shown as ?. Mach-O executables are not covered.
Checking a Range Against a File's Own Structure
For a file in a format the Trailing Data Checker has a parser for (PNG, JPEG, GIF, ZIP, BMP, PDF and so on), each flagged range has a Check this offset in Trailing Data Checker button. It sends the file and the offset, and that tool, after its own scan, says where the range lies: inside the structure the format accounts for, in a later segment, or in unvalidated trailing data. That is a statement about position only. The offset travels in the link; the file travels through this browser's session storage and expires after 30 minutes.
Why Chi-Square Is Shown but Does Not Flag
Under the uniform-byte model, the usual rule of thumb for the Pearson chi-square approximation is at least 5 expected observations in each of the 256 buckets, which is a window of about 1,280 bytes. It is a rule of thumb for that model, not a universal minimum. This tool never runs a formal significance test and never reports a p-value, so the number is computed the same way at every size; windows under 1,280 bytes are labelled descriptive only. With 256 byte values the statistic has 255 degrees of freedom, so a value near 255 is close to its expected value under a uniform-byte model when that approximation applies. It does not establish that the bytes are uniformly distributed, random or encrypted.
The strip under the chart colours each window by its distance from 255, clipped at three times that distance. It is a drawing aid, not a significance scale, and windows shorter than the selected size are hatched because their different byte counts make their raw values not comparable.
What the Results Look Like


Default High-Entropy Thresholds by Window Size
A window at or above its threshold is flagged random-looking. These are heuristic defaults, not statistical cutoffs; every value can be changed. A size between two presets gets a value interpolated between them.
| Window size | Default high threshold (bits per byte) |
|---|---|
| 256 B | 6.8 |
| 512 B | 7.3 |
| 1 KB | 7.5 |
| 4 KB | 7.7 |
| 16 KB | 7.8 |
| 64 KB | 7.9 |
Examples
Input: Zeros, then random (the Try a sample button): 4,096 bytes, the first 2,048 all 0x00 and the next 2,048 from Python's random.Random(20261111).randbytes(2048)
Result: At 1,024-byte windows: entropy 0.0000, 0.0000, 7.8088, 7.8091 and chi-square 261,120.00, 261,120.00, 246.50, 259.50. One low region at bytes 0–2047 and one high region at bytes 2048–4095. Whole file: entropy 4.9443, chi-square 260,465.125.
Meaning: A whole-file entropy of 4.9443 looks ordinary, yet exactly half the file is constant and half is random-looking. At the default 4,096-byte window this file is one single window and nothing is flagged; the 1,024-byte windows show the split.
Input: Text with a random tail: 40,960 bytes of repeated English text followed by 16,384 pseudo-random bytes (Try a sample)
Result: At 4,096-byte windows: one high region at bytes 40,960–57,343 (4 windows, average entropy 7.9556, chi-square 252.16). Whole-file entropy 6.1342.
Meaning: The appended data begins exactly where the text ends because the change falls on a window edge. In general the start of a region is accurate to one window.
Input: Random between padding: 32,768 zero bytes, 32,768 pseudo-random bytes, then 32,768 bytes of 0xFF (Try a sample)
Result: Three regions: low 0–32,767, high 32,768–65,535, low 65,536–98,303. The low and high ranges never merge, although they touch.
Meaning: Ranges merge only when they cross the same threshold. Two different kinds of unusual data next to each other stay separate entries.
Input: In our tests, a real file: 2,493,885 bytes of English words from macOS (/usr/share/dict/web2)
Result: Whole-file entropy 4.3270. No range is flagged at the default settings.
Meaning: Text stays far below the high threshold, so a text file raises nothing. Its serial correlation is −0.0800.
Input: In our tests, the same words compressed with xz -9 (637,572 bytes) and encrypted with openssl AES-256-CBC (2,493,904 bytes)
Result: Entropy 7.9997 for the xz file and 7.9999 for the AES file; both are flagged random-looking over their whole length at the default settings.
Meaning: Compressed and encrypted data look the same to entropy and chi-square, so a high-entropy range cannot tell you which one it is, or whether it is hidden at all.
Input: In our tests, 600,000 bytes of English words, then 400,000 bytes of AES-encrypted data, then 600,000 more bytes of the words (1,600,000 bytes)
Result: At 4,096-byte windows one high region at bytes 602,112–999,423. At 256-byte windows the region is bytes 600,064–999,935.
Meaning: The 4,096-byte scan puts the start within one window of 600,000 (the window that straddles the change mixes both kinds of data and does not reach the threshold); the 256-byte scan narrows it to within 256 bytes.
How it works
Read
A background worker reads the file in 8 MB slices. During the scan the page does not read the file into memory (it keeps the file you selected and the worker reads the slices); the whole file is read again only if you press a button that sends it to another tool. A window that straddles two slices is computed from its own bytes, so slicing never changes a number.
Count
For each window the worker counts how often each byte value occurs and derives the entropy and the chi-square from those counts. The whole file is counted in the same pass.
Classify
Entropy is compared with the high and low thresholds for the window's size. Consecutive qualifying full windows merge; single ones are listed as isolated anomalies; the short last windows are judged on their own.
Show and hand off
The chart draws a lowest-to-highest bar for every group of windows when there are more than 3,000, so a short spike or dip is never averaged away. Each flagged range can open in the Hex Viewer at its offset.
What the results mean
| Result | What it means | What to do |
|---|---|---|
| Random-looking range | Entropy at or above the high threshold for the window size. Compressed, encrypted and genuinely random data all look like this, and so does much compressed media data (uncompressed media usually does not). | Open it in the Hex Viewer and check the first bytes for a known signature. The File Type Detector checks the beginning of the data it receives, so send just a flagged range to let it check that range's first bytes for a known signature (Next steps can send a part of the file). A match is a format clue, not proof of where the range came from or that anything is hidden. |
| Repetitive range | Entropy at or below the low threshold: a highly concentrated byte distribution, as in padding, repeated bytes or simple tables. | Usually ordinary (zero fill, tables). Look at it in the Hex Viewer or list its strings. |
| Detected region | Two or more consecutive full windows crossed the same threshold. Its start and end are window edges. | Re-scan finer to narrow the boundary. |
| Isolated anomaly | One full window crossed a threshold and its neighbours did not. | It can still be real (a short appended block), so it has its own Open in Hex Viewer button. |
| Partial-window finding | A window shorter than the selected size, at the end of the file, crossed the threshold for its own size. | Read it with its byte count: a short window is a noisier measurement. |
| Insufficient sample for anomaly classification | A window under 256 bytes. Its entropy and chi-square are shown, but there is no calibrated threshold. | Open the bytes in the Hex Viewer if they matter. |
| No anomalies detected | No window crossed either threshold at these settings. | This says nothing about what the file contains. Try a smaller window or different thresholds. |
Limitations
- This tool measures statistics; it does not decrypt, decompress, carve or identify anything. A random-looking range may be compressed data, encrypted data, a media file's payload or noise, and entropy cannot tell them apart (see the xz and AES example above).
- Window-resolution boundaries: a region starts and ends on window edges, so a change in the middle of a window can be missed or placed up to one window away. Re-scan finer to narrow it; the exact byte is for the Hex Viewer.
- The default high thresholds come from a simulation of random data and are heuristic defaults, not statistical cutoffs. In our run of the blueprint's procedure (independent buffers from the operating system's random source, 10,000 buffers at 256 and 512 bytes down to 1,000 at 65,536 bytes) none of the random buffers fell below the default threshold for its size. That is a statement about that sample, not a guarantee for every source or file, and these results describe the tested buffers, not a guaranteed false-positive rate when scanning a file that contains many windows. Sizes between presets use an interpolated, unsimulated estimate.
- Chi-square below about 1,280 bytes is descriptive only, and chi-square never flags a window. No p-value is computed.
- The limit is 200 MB, or 50 MB on phones and on devices that report little memory or few processor cores. A scan that takes longer than 20 seconds is stopped. The finest scan (256-byte windows with overlap) of a large file makes millions of windows; the page warns before you start it on a file over 50 MB.
- Hand-off to other tools is limited by the device (20 MiB on a phone or a low-memory device, 100 MiB otherwise). Above that, the Hex Viewer still opens at the right offset but you load the file there yourself. Only metadata (offset, highlight length of at most 65,536 bytes, and the source tool) goes in the link.
- PE and ELF section analysis reads only the section table the file declares and is shown beside the window scan; it does not repair or validate the executable, does not follow Mach-O, and a section table that is truncated, out of range or malformed is reported with a note and never guessed. Only the first 512 bytes are matched against the File Type Detector's signatures, to name the file at offset 0. This tool does not parse a format's structure, so it cannot tell a ZIP's directory from its data; the Trailing Data Checker does that for the formats it knows.
- Tested in Chromium (full), with a Firefox and WebKit smoke pass, on real files from public collections and this machine (images, PDFs, archives, audio, executables, firmware, compressed and AES-encrypted files). The numbers were compared with an independent Python implementation on 40 files and about 237,000 windows. Real phones were not tested (a 390 px emulated screen was). PE and ELF section tables were checked against an independent Python parser and Apple objdump on 11 real executables (6 .NET PE32+, 1 PE32, 1 PE32+ x86-64, 3 ELF). Mach-O (macOS) executables are not analysed by section.
Privacy
Your file is read and analysed locally in your browser, in a background worker. This tool does not send it to our servers, and neither its name nor its bytes are passed to analytics: analytics events carry feature names and coarse file facts (type and size bucket) only. This statement is about this tool's own code; it does not cover third-party scripts, and a browser page cannot fully prevent other scripts on the same page from reading it. Optional analytics and advertising scripts load only after you accept optional cookies. If you open a range in another tool, the file (within the device limit) is stored in your browser's IndexedDB so the next page can read it; it is not sent to a server, the next page ignores it after 30 minutes, a newer transfer replaces it and Clear shared data on the Next steps tab removes it at once. Only your pinned tabs are remembered in localStorage, never your file or its contents.
Frequently Asked Questions
Does high entropy mean this file contains hidden data?
No. High entropy means the byte values are relatively evenly distributed in the measured range. Compressed archives, compressed media data and properly encrypted data can all have this property. It is a hint about where to look, not proof of randomness or of anything hidden.
What is the difference between entropy and chi-square?
Entropy measures the uncertainty implied by how the byte values are distributed (it does not capture every form of sequence predictability). Chi-square measures how evenly the 256 byte values are spread compared with a uniform distribution. Both describe the byte-frequency distribution but summarise it differently: entropy as the uncertainty implied by the byte-value distribution, chi-square as a distance from perfectly even counts (it is 0 only when all 256 values occur equally often, which needs a size divisible by 256). They usually agree but not always. This tool flags windows by entropy only and shows chi-square, with its byte count, as context.
Why does chi-square need a bigger window than entropy?
Under the uniform-byte model the usual rule of thumb wants about 5 expected counts in each of the 256 buckets, roughly 1,280 bytes, for the standard Pearson approximation to be dependable. It is a rule of thumb, not a universal minimum. This tool never runs a formal test or reports a p-value, so the number is still computed and shown, labelled as descriptive only.
What window size should I use?
Start with the default, 4,096 bytes. A flagged region's boundaries are accurate to one window, so use Re-scan finer on it to halve the window, down to 256 bytes, and then turn overlap on. Small windows are noisier.
How do I check if a file is encrypted?
Load the file and look at its entropy. Encrypted data usually measures close to 8 bits per byte, but so does compressed data, so a high reading suggests encryption or compression and does not prove either. This tool shows the whole-file entropy, then scans windows so you can see whether the whole file is random-looking or only one range, and lists that range with its offsets. To go further, open the range in the Hex Viewer and look for a recognisable header or format signature. Finding one can help identify a known format; not finding one does not establish encryption, because many formats have no easily recognisable signature at the offset you look at and encrypted containers can carry headers of their own. Telling what the data is needs format-specific evidence or other independent analysis. Nothing here decrypts or identifies the data.
How do I find where encrypted or compressed data starts in a file?
Load the file and look at the entropy chart: a stretch near 8 bits per byte after lower-entropy data is a candidate. The detected-regions list gives its start and end offsets, and Open in Hex Viewer jumps there. Whether that range is encrypted, compressed or neither is something this tool cannot tell you.
Does this tool decrypt or decompress anything?
No. It only measures and flags. After you have an offset, use the Hex Viewer, the Strings Analyzer or the Trailing Data Checker to go further.
Is this the same as the Steganography Detector?
No. The Steganography Detector examines the pixel data of images, and the samples of WAV audio, for statistical indicators associated with LSB steganography. This tool works on the raw bytes of any file and answers a different question: where does this file's randomness change.
Is my file uploaded to a server?
No. The file is read and analysed in your browser by a background worker. Its name and bytes are not sent to analytics or to our servers. If you open a range in another tool, the file is kept in your browser's IndexedDB for up to 30 minutes so that tool can read it.
Is there a size limit?
The limit is 200 MB, or 50 MB on phones and on devices that report little memory or few processor cores. A scan that takes longer than 20 seconds is stopped. A file over the limit is refused before anything is read.
What do the JSON and CSV exports contain?
JSON has the scan settings, every window (start, end, length, entropy, chi-square, partial flag and classification), the three lists, the byte-frequency table and the format marker. CSV has one row per window with offset, length, entropy and chi_square. Neither contains bytes of your file.
Related Tools
Hex Viewer
Read the bytes at a flagged offset
File Type Detector
Check what the first bytes say the file is
Strings Analyzer
List readable strings in the file
Trailing Data Checker
Check for data after a file's own structural end
XOR Brute Forcer
Test whether the range may have been obfuscated with a repeating XOR key
Steganography Detector
Statistical indicators of LSB steganography in images and WAV audio