.diff Differences between files

Text & source code

MIME typetext/x-patch
DescriptionDifferences between files
CategoryText & source code
Signature (magic bytes)2A 2A 2A 09 (***.)
2A 2A 2A 20 (*** )
2D 2D 2D 20 (--- )
Based ontext/plain
Other extensions.patch

Frequently asked questions

What is a .diff file?

A .diff file is a “Differences between files” (MIME type text/x-patch).

How do I open a .diff file?

With any text editor – Notepad++, Visual Studio Code, or gedit and vim on Linux. The file contains readable text, possibly source code or configuration.

How can you tell a genuine .diff file?

By the bytes at the start of the file, the signature (magic bytes): 2A 2A 2A 09 (***.), 2A 2A 2A 20 (*** ) and 2D 2D 2D 20 (--- ). On Linux and macOS, file --mime-type example.diff checks the real type regardless of the extension.

Which format is .diff based on?

Technically a .diff file is a subtype of “Plain text document” (text/plain), so programs for that base format can often read it too.

Which MIME type belongs to .diff?

The MIME type is text/x-patch. In the Apache web server: AddType text/x-patch .diff; in nginx: types { text/x-patch diff; }.

Nearby entries