Unified Patch Inspector

Inspect a patch file and download an exact-context result preview for supplied source.

On-device No sign-up Free to use

Inspect patch controls

Showing an example. Edit to see your own.

Drop your text file here

or choose one from your device

Optional UTF-8 text up to 100,000 bytes. A chosen file replaces the pasted patch.

    ?

    Ordinary unified hunks only. Up to 2,000 lines, 50 files and 200 hunks. Combined and binary patches are refused.

    ?

    Preview checks every old/context line at its exact line number. Up to 10,000 lines and 100,000 characters.

    ?

    For a multi-file patch, enter the exact old or new path (up to 240 characters). Leave both this and Source text blank to inspect without previewing.

    Processed in your browser. Your inputs stay on this device.

    Result

    Showing an example.

    Replace Old line with New line in greet.txt using exact three-line source context.

    Inspected 1 file and 1 unified hunk. No commands or filesystem operations were run. Exact-context preview prepared for greet.txt.

    Loading the tool. Your result will appear here.

    https://usefreetools.net/unified-patch-inspector · 20 November 2026

    Was this helpful?

    How to use Unified Patch Inspector

    1. Paste an ordinary unified patch with file headers and hunks, or choose one UTF-8 diff/patch file to replace the text.
    2. To inspect without a source preview, clear both Source text and File path to preview. Read the file, addition, deletion and hunk counts.
    3. For a preview, enter the exact original source. A multi-file patch also needs a path identifying one old or new file section; headers with a/ or b/ are shown without that prefix.
    4. Inspect the resulting text and download patched-preview.txt when a preview succeeds. No file on your device is modified.

    Example: Unified Patch Inspector

    Replace Old line with New line in greet.txt using exact three-line source context.

    You add
    Unified patch: --- a/greet.txt +++ b/greet.txt @@ -1,3 +1,3 @@ Hello -Old line +New line Bye; Source text for preview (optional): Hello Old line Bye ; File path to preview (for a multi-file patch): greet.txt
    You get
    Inspected 1 file and 1 unified hunk. No commands or filesystem operations were run. Exact-context preview prepared for greet.txt.

    Options

    Patch input
    A chosen UTF-8 .diff or .patch file replaces the pasted patch. Ordinary unified file headers and complete, correctly counted hunks are required; binary and combined diffs are refused.
    Exact-context preview
    The source must match old/context lines at the declared positions, including final-newline state. There is no fuzzy search for a nearby match. A failed comparison returns a conflict instead of a guessed output.
    Selecting a file
    For multiple file sections, enter an exact old or new path that identifies one section. A new-file patch needs empty source. Clear both source and path when you want counts without applying any preview.

    Supported inputs and limits

    • Pasted patch up to 100,000 characters, 2,000 lines, 50 file sections and 200 hunks.
    • A chosen UTF-8 patch file is limited to 100,000 bytes.
    • Preview source accepts 100,000 characters and 10,000 lines; a preview path accepts 240 characters.
    • Malformed counts, overlapping or out-of-order hunks, invalid final-newline markers, combined diffs and binary patches are refused.
    • No fuzzy matching, commands, filesystem writes or code execution occur.

    Where your input is processed

    This tool does not upload your inputs. See the limits for anything saved on your device.

    A hunk describes both versions

    Hunk headers declare old and new ranges. Context lines occur in both versions, minus lines belong to the old source and plus lines belong to the new source. Counts must agree with those lines before an exact-context preview can be trusted.

    Questions about Unified Patch Inspector

    Does this run git apply or patch?

    No. The page reads the supplied text and compares hunk context locally. It does not launch a command or change your project files.

    Why does a valid-looking hunk conflict?

    The supplied source may differ from the patch's expected lines or final line ending. Exact-context preview deliberately avoids guessing a new position for unmatched text.

    Can it inspect binary or combined diffs?

    Those forms are outside the stated ordinary unified-patch support. A refusal means this preview cannot interpret the patch; it is not a verdict on whether another patch engine could use it.

    What should I check before using a preview?

    Confirm the intended path, original source and every changed line. A matching hunk does not establish that the code change is correct or safe to execute.

    Page updated · Project managed by Tony Hines · Report a problem with Unified Patch Inspector