Geek With LaptopLaptop help for students and writers Geek With Laptop, home
  1. Home
  2. How-To
  3. How to Check Whether a File Has Been Altered

How to Check Whether a File Has Been Altered

You have two copies of a file, or one copy and a memory of what it used to say, and you need to know whether anything changed. A laptop can answer the first question exactly and the second only in part. This guide covers both, and is clear about where the evidence stops.

By GuideReviewed September 2026

Summarize with AI

Two identical bare 2.5 inch drives side by side on a dark bench mat with a precision screwdriver between them, seen from overhead

Quick answer

Hellothe quick answer is

To check if a file has been altered, compute its SHA-256 hash and compare it with the hash of a copy you trust: certutil on Windows, shasum on a Mac, sha256sum on Linux. Matching hashes mean the bytes are identical. If they differ, use document compare, embedded metadata or Content Credentials to see what changed and when.

Easy 5 min per file

Works on Windows 10 and 11, macOS, Linux

Key facts
Time5 minutes per file
DifficultyEasy
You needThe file, a reference copy or its published hash, and a terminal
Works onWindows 10 and 11, macOS, Linux
ReviewedSeptember 2026

Part of your laptop as the authorship record

What a hash tells you

A cryptographic hash turns a file of any size into a short fixed-length string. SHA-256, defined in NIST's Secure Hash Standard (FIPS 180-4), produces 64 hexadecimal characters, and changing a single byte of the input produces a completely different result. The standard is built so that finding two different files with the same hash is not feasible in practice. That makes a hash a fingerprint: if two files hash the same, they are the same bytes; if the hashes differ, something in the file differs, even if it is only a space.

The limitation is just as important. A hash tells you that two copies differ. It cannot tell you what changed, who changed it, or when. And it needs something to compare against: a copy you kept, a hash you wrote down earlier, or a hash the publisher listed next to the download.

Compute a SHA-256 hash on Windows, macOS and Linux

One command per system; the output is 64 hexadecimal characters.
SystemOpenCommandNotes
Windows 10 and 11Start, type cmd or Terminalcertutil -hashfile "C:\path\file.docx" SHA256Documented in Microsoft's certutil reference; the algorithm name is not case-sensitive
macOSApplications, Utilities, Terminalshasum -a 256 /path/file.docxDrag the file into the window to paste its path
LinuxAny terminalsha256sum /path/file.docxAdd -c with a checksum file to verify many files at once
Windows, PowerShellStart, type PowerShellGet-FileHash file.docxUses SHA-256 unless told otherwise

Compare the two strings character for character, or paste both into a text editor and use its find function. Case does not matter. Hashes of copies on different machines match perfectly if the files are identical, whatever their filesystem dates say, which is why a hash is the cleanest answer to the question this guide is about.

Check if a file has been altered, step by step

  1. Step 1: Decide what you are comparing against

    A hash needs a reference. Options are a copy in a backup snapshot, an email attachment you sent, a version from cloud history exported to disk, or a hash you recorded when you finished the work. Without any of these, skip to the metadata and content checks below.

  2. Step 2: Hash both copies

    Run the command for your system on the file in question and on the reference. Save the output in a text file with the date and the full path of each file.

  3. Step 3: Compare the results

    If they match, the files are byte-identical and no further checking is needed. If they differ, the rest of the steps find out how.

  4. Step 4: Run a document compare

    Word processors can compare two documents and mark every insertion and deletion. In Word, open the Review tab and choose Compare; in cloud editors, the version history panel shows changes between any two versions. Most PDF readers have a Compare Files tool. For plain text, a diff utility does the same.

  5. Step 5: Read the edit metadata

    Open File, Info in an Office document for the last saved date, last modified by, revision number and total editing time. Open File, Properties in a PDF for the modification date, the creating application and the producer. A producer name that differs from the original application is a sign the PDF was re-saved.

  6. Step 6: Check photos separately

    For an image, read the EXIF Software tag and the modification date with the method in the photo metadata guide, then drop the file onto the public verify page described in the Content Credentials checking guide. A credential that no longer validates means the bytes changed after signing.

  7. Step 7: Record what you found

    Write down the two hashes, the tool used, the date, and the specific differences the compare showed. A short factual note is what a reviewer or a colleague can act on.

Checks by file type

Which check applies to which kind of file.
File typeExact checkWhat the format records about editsWeak spots
Word, Excel, PowerPointSHA-256 against a reference; Review, CompareLast saved date, last modified by, revision number, editing timeProperties are editable; Save As resets some
PDFSHA-256; the reader's compare toolCreation and modification dates, creator and producer applicationsRe-saving through a print-to-PDF driver wipes the history
Photos (JPEG, HEIC, RAW)SHA-256; Content Credentials validationEXIF Software tag, ModifyDate, C2PA edit history if signedScreenshots and social uploads strip everything
Plain text, Markdown, codeSHA-256; diff or version controlNothing inside the file; commits in a repositoryOnly as good as the commit habit
Video and audioSHA-256Container metadata, encoder nameRe-encoding changes every byte and looks like editing

What a mismatch does and does not prove

A hash mismatch proves that the two files are not the same bytes. It does not prove that the content changed in any way a person would notice. Opening a document and saving it without typing, re-exporting a PDF, letting a cloud client re-encode an image, or a photo app rewriting a thumbnail all produce a new hash. Run the document compare before drawing any conclusion, and treat a mismatch with no visible difference as a re-save until something shows otherwise.

Metadata cuts the other way. Edit counts, author names and dates inside a document are stored as plain values that many tools can rewrite. Microsoft's support page on file properties says the author, title and similar fields are editable from inside the app, while the dates and statistics are updated automatically, and nothing stops other software rewriting either kind. They are a useful narrative when they agree with the hash and the compare, and a weak argument on their own. The same holds for Content Credentials: the C2PA explainer states that validation checks whether the record is intact and signed by a trusted party, and makes no judgment about whether the content is true.

Two more limits. A file with no reference copy cannot be hash-checked; the most you can do is read its internal history and look for inconsistencies such as a creation date later than the last save. And a matching hash proves the file is unchanged since the reference was made, which says nothing about what happened before that.

Common mistakes

  • Hashing the wrong thing. A hash of an exported PDF says nothing about the source document. Compare like with like.
  • Comparing a cloud copy with a local one. Some sync clients rewrite files on the way down. Hash the copy you actually intend to rely on.
  • Treating a re-save as tampering. Run the compare first. No visible change plus a new hash is almost always a re-save.
  • Trusting a hash from an untrusted source. A hash printed on the same page as a modified download proves nothing. The reference has to come from somewhere the file's editor could not touch.
  • Forgetting to record the reference hash in the first place. The check only works if you kept one. Make it part of finishing a piece of work, alongside the version history habit.

Once you can check if a file has been altered, the next question is usually when it began, which the guide to reading and corroborating a file's creation date answers, and whether an old copy exists, which is where dated backup snapshots come in. Both sit in the site's authorship record collection.

More task guides sit in the task-based laptop guides. A hash answers whether a file changed; for a photo, validating a signed Content Credential answers whether it changed since the camera or app signed it, and reading the EXIF fields on a laptop shows the software that last touched it. When the question turns from whether to when, use the guide to corroborating the creation date of a file.

Common questions

Can two different files have the same SHA-256 hash?

In theory yes, because the hash is shorter than most files. In practice no known method produces one, which is why NIST still approves SHA-256 for integrity checks. Older algorithms such as MD5 and SHA-1 have known collisions and should not be relied on.

Does renaming a file change its hash?

No. The hash covers the contents only. Renaming, moving or copying a file leaves it unchanged, which is one reason hashes are more useful than filesystem dates.

Does opening a file change its hash?

Opening and closing without saving does not. Some apps save automatically or rewrite metadata on close, so check the modified date before assuming.

Can I check if a file has been altered without an original?

Only partially. Read its internal dates and properties, look for inconsistencies, and for photos check whether a Content Credential validates. None of that replaces a reference copy.

Is a hash the same as a digital signature?

No. A hash proves two copies match. A signature ties a hash to a signing key held by a person or organisation, so it also says who vouched for the file. Content Credentials use signatures; a checksum on a download page is only a hash.

Sources

  1. Microsoft Learn: certutil

    the -hashfile option that generates a cryptographic hash over a file.

  2. NIST: FIPS 180-4, Secure Hash Standard (SHS)

    the SHA-256 algorithm and the family of approved hash functions.

  3. C2PA: C2PA and Content Credentials Explainer

    what validation of a credential does and does not judge.

  4. Microsoft Support: View or change the properties for an Office file

    which document properties are editable and which are updated automatically.

In this section

Guides in this section, with time and difficulty
GuideTime
How to Connect a Laptop to a TV5 to 15 minutes
How to Print Screen on a LaptopUnder a minute
Forgot Your Windows Password? How to Get Back In10 minutes to 1 hour
How to Run an AI Writing Assistant Offline on a Laptop20 to 40 minutes
How to Keep Version History of Your Drafts10 to 20 minutes, once
How AI Writing Detectors Work, and How to Read a Score10 minutes to read, 5 to test
How to Transcribe Audio Offline on a Laptop15 minutes to set up, then roughly real time or faster per recording
How to Turn Off Built-In AI Features on a Laptop15 to 20 minutes
How to Check a Photo's Metadata Before Sharing It5 to 10 minutes
How to Check an Image's Content Credentials (C2PA)5 minutes per image
Flagged by an AI Detector? How to Show Your Writing Process30 to 60 minutes to gather the record
How to Disclose AI Writing Help at School and Work10 minutes per piece of work
AI Text Watermarking Explained: What It Can and Cannot Prove10 minutes to read
Plagiarism Checkers vs AI Detectors: How to Read Both Reports10 minutes to read
How to Prove When a File Was Created20 to 40 minutes
How to Check Whether a File Has Been Altered5 minutes per file
How to Turn Off Copilot in Windows 11: Button, Key and App10 to 15 minutes for every switch
How to Turn Off Windows Recall and Delete Its Snapshots5 to 10 minutes
How to Turn Off Apple Intelligence on a Mac2 minutes on macOS 15 or 26, about 10 on macOS 27
How to Turn Off Grammarly in Your Browser, Word and Desktop App1 to 5 minutes
How to Turn Off AI Overviews in Google Search (What Actually Works)5 minutes
How to Turn Off Gemini on a Laptop: Chrome, Google Account and Chromebook10 minutes for all of them
How to Turn Off Gemini in Gmail and Google Docs5 minutes
Best AI Tools for Students, Grouped by the Job Each One Does10 minutes to read, a few minutes to set up each tool
Best AI Note-Taking Apps for Lectures and Meetings, Compared10 minutes to read, 5 minutes to set up an app
How to Check Your Essay Before You Submit ItAbout 30 minutes

, Editor. Sets up, fixes and chooses laptops for other people, then writes down what worked. About the editor. About this site. Reviewed September 2026.