.patch Differences between files
Text & source code
| MIME type | text/x-patch |
|---|---|
| Description | Differences between files |
| Category | Text & source code |
| Signature (magic bytes) | 2A 2A 2A 09 (***.)2A 2A 2A 20 (*** )2D 2D 2D 20 (--- ) |
| Based on | text/plain |
| Other extensions | .diff |
Frequently asked questions
What is a .patch file?
A .patch file is a “Differences between files” (MIME type text/x-patch).
How do I open a .patch 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 .patch 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.patch checks the real type regardless of the extension.
Which format is .patch based on?
Technically a .patch 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 .patch?
The MIME type is text/x-patch. In the Apache web server: AddType text/x-patch .patch; in nginx: types { text/x-patch patch; }.