Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is File Carving?

File carving recovers files from raw data by recognising their internal structure, ignoring the file system entirely. It is how deleted documents and images are retrieved when the metadata is gone.

Illustration for the cybersecurity term File Carving
Home / Blog / Cybersecurity Terms / What Is File Carving?
17 November 2026

What Is File Carving?

What Is File Carving?

File carving recovers data by looking for the shape of files rather than for entries in a directory. A JPEG begins with a recognisable two-byte marker and ends with another; a PDF starts with a version string and ends with an end-of-file marker; a ZIP archive has a local file header and a central directory. A carving tool scans a disk image byte by byte, finds those patterns, and extracts whatever lies between them — without ever consulting the file system.

When You Need It

Deleting a file usually removes the metadata record that points to its content while leaving the content in place. If the record survives, standard recovery is simpler and more accurate because you get the filename, the path, and the timestamps. Carving is what you do when that record is gone: after a format or a partition table rebuild, on a corrupted volume, in the unallocated space of a disk that has been in use for years, inside a memory dump or a page file, or in network capture data.

It also reaches places a file system view cannot. File slack — the space between the end of a file and the end of its last cluster — routinely holds fragments of whatever occupied the cluster before, and hibernation files, swap, and volume shadow copies all contain recoverable structures.

How the Techniques Differ

The Tools

PhotoRec is the pragmatic default, recognising several hundred formats and handling fragmentation reasonably. Scalpel and Foremost carve from configurable signature databases and are easy to script. bulk_extractor takes a different approach, scanning for feature types such as email addresses, card numbers, URLs, and JSON fragments rather than whole files, which is frequently more useful in an intrusion investigation than recovering the files themselves. Autopsy and the commercial suites include carving modules that integrate results with the rest of the case.

Living With the Limitations

Carved output is unreliable in specific, predictable ways, and the report has to say so. There is no filename, no original path, and no timestamp, because all of that lived in the metadata you no longer have. Fragmentation produces files that open but contain content from two sources. False positives are common, since a signature can occur by chance inside unrelated data. Encrypted and compressed content carves as noise. On solid-state drives, TRIM and garbage collection may have zeroed the blocks long before you arrived, so a carve that returns little is not evidence that nothing was deleted.

Validate rather than assume. Open or parse every file that matters, check internal metadata such as EXIF against the claimed content, and hash the results. Where a carved document is central to a case, corroborate it with something that does carry context — a shortcut file, a jump list entry, an email attachment record, or a surviving master file table entry that names the same content.

Carving is also a data protection consideration in corporate work: scanning unallocated space surfaces material unrelated to the investigation, including personal data belonging to other employees. Scope the exercise, document the lawful basis, and dispose of what you do not need. Our digital forensics services apply those boundaries before the first scan rather than after it.

FAQ – Frequently Asked Questions

What Is the Difference Between File Carving and File Recovery?

File recovery uses surviving file system metadata, so it returns the original name, path, and timestamps. Carving ignores the file system and reconstructs files purely from their internal signatures and structure, which works when the metadata is gone but returns content without context. Try metadata-based recovery first, then carve the unallocated space for what it missed.

Why Do Carved Files Often Fail to Open?

Usually fragmentation. Carving assumes a file occupies contiguous sectors, so if the operating system split it across the disk the extracted data contains the first fragment plus whatever followed it physically. Formats without an end marker also get a fixed-length extraction that includes trailing data. Structure-aware carvers and fragment recovery techniques improve the outcome but do not eliminate the problem.

Does Carving Work on SSDs?

Less reliably than on magnetic disks. TRIM commands and background garbage collection cause the controller to erase blocks belonging to deleted files without any host instruction, often within minutes. Recovery may still succeed where TRIM was unsupported or disabled, or where the data was overwritten rather than deleted, but a limited result proves nothing about what was there.

Can Carved Files Be Used as Evidence?

Yes, with careful framing. State that the file was recovered from unallocated space without file system metadata, so there is no original filename, path, or timestamp, and explain the validation applied. Corroborate with artefacts that do carry context, such as shortcut files, jump lists, or registry entries referencing the same content, and record the carving tool and version used.

Related Terms

You May Be Interested In These

What Is Command and Control (C2)?

Cybersecurity Terms

17 November 2026

What Is Command and Control (C2)?

Read More
What Is Active Directory Security?

Cybersecurity Terms

17 November 2026

What Is Active Directory Security?

Read More