.fw files.wiki
ZIP

ZIP Files

ZIP Archive Format

ZIP is a widely used archive container that bundles files and folders, usually with lossless compression and optional encryption.

ZIP archive

Most common
Developer
PKWARE, Inc.; Phil Katz
Category
Archives & Compression
MIME type
application/zip
Format
Container
Magic bytes
50 4B 03 04
First released
1989
Latest version
APPNOTE 6.3.10
Open standard
Yes

Split ZIP archive segment

Developer
PKWARE, Inc.; Phil Katz
MIME type
application/zip
Format
Container
Magic bytes
50 4B 07 08
First released
1989
Latest version
APPNOTE 6.3.10
Open standard
Yes

Java JAR archive using ZIP structure

Developer
Sun Microsystems; Oracle
MIME type
application/java-archive
Format
Container
Magic bytes
50 4B 03 04
First released
1997
Latest version
JAR File Specification, Java SE 21
Open standard
Yes

Office Open XML package mislabeled with .zip

Developer
Microsoft; ECMA International; ISO/IEC
MIME type
application/zip
Format
Container
Magic bytes
50 4B 03 04
First released
2006
Latest version
ISO/IEC 29500:2021
Open standard
Yes

OpenDocument package mislabeled with .zip

Developer
OASIS; ISO/IEC
MIME type
application/zip
Format
Container
Magic bytes
50 4B 03 04
First released
2005
Latest version
ODF 1.3
Open standard
Yes

Android application package mislabeled with .zip

Developer
Google; Open Handset Alliance
MIME type
application/vnd.android.package-archive
Format
Container
Magic bytes
50 4B 03 04
First released
2008
Latest version
APK Signature Scheme v4 era
Open standard
No

ZIP self-extracting archive renamed .zip

Developer
PKWARE and third-party archivers
MIME type
application/zip
Format
Container
Magic bytes
4D 5A
First released
1990
Latest version
varies by SFX stub
Open standard
No

Open a .ZIP file online

Reading file…

What is a .ZIP file?

Usually a ZIP file is a ZIP archive - container which holds one or more members being files/directories, having an index of its members, an opportunity of member’s data compressing, the possibility of calculating a checksum CRC-32 for a single item or the entire collection of member's data within one stream, the information of each of members' modification times with time and date stamps for file creation, updating, access and archiving operations, an optional comments feature and possible encryption. The idea was developed by Phil Katz in the context of creating PKZIP tool for compressing files by a certain proprietary scheme. It became open format after development of ZIP utility but still remains compatible with PKWARE’s APPNOTE standard specifications.

ZIP files have the greatest popularity due to downloading of content, attachments of messages sent through internet communication channels and other reasons, including distribution of a program or documents, making back ups in some archive form. There are several other popular formats which are ZIP-based but use their own extensions, such as JAR files with mandatory META-INF/MANIFEST.MF file inside, Microsoft OpenXML formats - with a special [Content_Types].xml file, OpenDocument packages starting with an uncompressed mimetype entry, and Android application packages possessing DEX files in addition to mandatory AndroidManifest.xml. SFX are not real ZIPs - executable files. Their main marker is MZ signature at the beginning unlike a real ZIP, but not PK.

How to open a .ZIP file

Open a .ZIP file on Windows

  1. 1 Go to the folder with your file in File Explorer. Usually, downloaded files end up in Downloads.
  2. 2 Double-click your .ZIP file if you have an app for .zip files on your computer. In case it does not open, move on to step three.
  3. 3 Right-click your .ZIP file -> select Open with -> Choose another app.
  4. 4 Choose File Explorer in the list (Windows 11: choose Always). For Windows 10 -> put a check on "Always use this app to open .zip files" and click OK.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Windows

Open a .ZIP file on macOS

  1. 1 In the Finder app, locate your .ZIP file.
  2. 2 Just double-click your .ZIP file in order to automatically launch the program which is connected with it.
  3. 3 Need another app on your Mac? Control-click the file (or right-click with a mouse). In the pop-up menu select Open With -> Archive Utility.
  4. 4 If it isn't in the list, choose Other… and find the application manually.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for macOS

Open a .ZIP file on Linux

  1. 1 Launch your file manager. Depending on the desktop it may be named Files (GNOME), Dolphin (KDE Plasma), Nemo (Cinnamon) or Thunar (Xfce).
  2. 2 Double-click the file.
  3. 3 Or choose another program by right-clicking the file -> Open With -> File Roller.
  4. 4 Install File Roller (if it is not installed on your computer) from the software centre, repository or Flathub.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Linux

Open a .ZIP file on Android

  1. 1 Launch Files or another file management app.
  2. 2 In Downloads, find the .ZIP file and open it by tapping.
  3. 3 A list of apps capable of opening the file will be shown. Tap Files by Google and press Always to permanently connect the file type with this app.
  4. 4 No apps able to open this file? Download Files by Google from the Google Play Store.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Android

Open a .ZIP file on iPhone / iPad

  1. 1 Use the Files app and go to On My iPhone, iCloud Drive or Downloads.
  2. 2 Tap the .ZIP file you want to open.
  3. 3 If the file can be opened by a built-in iOS app (supported format), it opens automatically.
  4. 4 Touch and hold the file to get the context menu -> choose Share -> select a suitable app from the list of apps.
  5. 5 If there is no such option, download the app first from the App Store and then tap the document again.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for iPhone / iPad

Open a .ZIP file online

  1. 1 Move to the online viewer at the top of this page.
  2. 2 Drag the file there or select it, and its contents will appear in your browser tab. The file is not uploaded.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Online

More details about opening .ZIP files

In cases when using Windows OS version 10/11 to unzip archive files, it will be enough to use built-in function of Compressed folders of Windows File Explorer without needing to add any separate software. If a user needs to work with ZIP archives which have encryption or split volumes, 7-Zip, PeaZip might be helpful, as both programs give more diagnostics than standard Compressed Folder feature does.

For Macs, Finder as well as Archive Utility program might be used to pack/unpack basic ZIP archives; The Unarchiver will be able to unpack multipart or those archives which were prepared on machines other than Mac. To unzip files, GNOME/Linux users would choose such software as File Roller or Ark (for KDE users). On command line, Linux users often will need such software as Unzip, zip, bsdtar or 7z for extracting/checking. On Android, people could start with file managers such as Files by Google and, having encountered with troubles, use ZArchiver and others such as WinZip or RAR for extracting files packed with passwords. In cases with iPhone or iPad, native Files application provides such features like preview and unpack archive in the same time as iZip and WinZip would enable users to create archive and deal with archive's password protection etc. Using the Web, B1 Online archiver will provide unpack/archive capabilities via browser but users will better store files offline in this case as otherwise it might cause data leakage because files would be transferred and available for the server provider's access. In cases when one could not manage to use "double click", users should download it manually to computer, check presence of all files, do test command in case of 7-Zip, confirm rightness of file extension vs. archive headers and change association of unpacking on the OS's level.

Technical details

ZIP is not a text format but rather a binary one. An ordinary ZIP starts with a local file header for every individual member, then proceeds with the data for that member, either compressed or stored. Data descriptors are appended right after some members if their CRC-32 or the compressed /uncompressed size wasn't known when generating the headers. A central directory, summarizing all the entries, follows, alongside an EOCD record positioned towards the end of the file. If it's a split ZIP, PKWARE specifies a split-segment marker in the beginning of every segment.

Canonical signatures in ZIP files are as follows: LFH - 50 4B 03 04 (usually, at an absolute offset 0 in non-empty ZIPs), CH - 50 4B 01 02, EOCD - 50 4B 05 06. Self-executable ZIP might have a so-called MZ stub right in front of the initial signature, so magic bytes won't always be at an offset zero. An entry has the fields, like CRC-32, compressed/uncompressed size, modification time/datetime, method (the ID of the compression), general-purpose flags, name of the file, possible extra fields, and, optionally, comments. Zero in the field of the method value means storing and no compression, and a method ID of 8 means Deflate. However, methods defined by PKZIP Application Note 6.3.10 (like BZIP2, LZMA, XZ, PPMd and Zstandard) might occur; nevertheless, they rely completely on the compatibility of a reader. Traditional legacy limit for files and zip archives was 4 GiB, and for entries 65,535. ZIP64 extended these limits using 64-bit integers.

Old versions of ZIPs would always use filenames encoded in code page 437 (IBM PC). Non-ASCII characters in filenames will be shown incorrectly by older tools, unless they were marked as being encoded in utf-8 (language encoding bit of the general-purpose bit flags field). ZIP Encryption might range from weak, deprecated and insecure ZipCrypto up to WinZip or Pkware implementation of AES, located in the extra fields of the headers.

The registered MIME type is application/zip. Derived file formats based on the format also use their specific MIME-types like application/java-archive for JAR, different office packages for correct OOXML and OpenDocument. A usual set of contents in ZIP archives is something ranging from tiny sources to huge backup sets, and sometimes contents, usually already compressed (JPEG, MP4, PDF), are getting smaller in the archive only nominally.

How to convert .ZIP files

The practical process that will result in successful conversion without any loss or corruption of content and format can be done through extracting the package's contents from the zip-archive. You just have to type: unzip input.zip -d output_folder, or do Extraction using Graphical Utilities (File Explorer in Windows, Archive Utility and File Roller, respectively). While preserving files and their directories, the ZIP-file will be decomposed into its initial components.

When converting software distribution packages to .tar.gz, you need to unzip them into directories using following command line and then zip those directories again into tar archive: unzip -q input.zip -d out && tar -czf output.tar.gz -C out . When going to tar file archive structure, expect some alterations with metadata storing, compression and packaging order. The same thing concerns creation of .7z-archive with 7-Zip archiver: 7z x input.zip -oout && 7z a output.7z out/*. With LZMA2 algorithm (and thus compression ratio will likely to increase a little), the package recipients will also need to be able to unarchive 7-zip files, e.g., through using 7-Zip software.

Using Rar as output format will be reasonable only in situations when recovery records, solid and multipart rar files needed. Raring process presupposes the existence of either WinRAR software or its alternative that has license of creating RAR-archive. For creating .iso image it will be necessary to do extraction procedure described above and further create iso-file with either genisoimage, mkisofs-compatible software or on macOS with hdiutil. If you are going to change archive's name to one of .docx, .xlsx, etc., don't forget about checking its [Content_Types].xml and other marker files first.

Convert toToolCommand / note
TAR archive bsdtar mkdir out && bsdtar -xf input.zip -C out && bsdtar -cf output.tar -C out . Preserves file data and most paths; ZIP comments, some extra fields, and Windows attributes may not map to TAR.
TAR.GZ compressed archive GNU tar / bsdtar mkdir out && unzip -q input.zip -d out && tar -czf output.tar.gz -C out . Useful on Unix systems; recompresses all files and may lose ZIP-specific metadata and encryption.
7Z archive 7-Zip 7z x input.zip -oout && 7z a output.7z out/* Often produces smaller archives with LZMA2; do not expect bit-for-bit preservation of ZIP headers or comments.
Extracted folder UnZip unzip input.zip -d output_folder Most common conversion: turns the archive back into ordinary files and folders.
ISO image genisoimage mkdir out && unzip -q input.zip -d out && genisoimage -o output.iso -J -R out Creates an optical-disk image from the extracted contents; bootability and permissions require additional options.
DOCX/XLSX/PPTX or ODT/ODS/ODP Manual rename after format identification If the ZIP contains [Content_Types].xml it may actually be an Office Open XML document; rename only after confirming the internal layout.

Common problems and fixes

"End-of-central-directory signature not found" usually means the file is not ZIP archive, or its truncated version, or only part of the split archive. Check the file size versus original, and ensure that first few bytes start with 50 4B 03 04 bytes for regular zip archive and 50 4B 07 08 for split chunk, then try downloading it anew if it's size is significantly smaller.

In case of 7-Zip, the error "Cannot open file as archive" suggests a corrupt archive or incompatible compression algorithm/encryption, self-extracting stub problem or file extension incompatibility. Use 7z t input.zip to analyze integrity of your archive; structure problems will be detected but the ones related to extractions may not be; "Unexpected end of archive" and "CRC failed" are typical indications that stored by zip program CRC-32 differs from the one computed on the extracted data; it can be attributed to either partial download/download using text transfer mode/defective magnetic storage area; you should replace archive in that case by another valid copy.

In some situations Windows File Explorer refuses to work with ZIP files stating the fact that "The Compressed (zipped) Folder is invalid". You have to resort to alternative ways - use 7-Zip or WinRAR. Split archives should contain all chunks in the same directory and named like this: .z01, .z02 and the full archive being .zip and trying to open .zip part may not yield good results.

Built-in tools often cannot deal with password prompts. For example, a ZIP-file encrypted using the AES algorithm won't let anyone extract its contents without the password, although the file names usually stay visible. The mojibake in files'names is most commonly attributed to usage of legacy code page (that doesn't allow utf-8 decoding); it's wise then to use software where encoding can be chosen by user manually. "ZIP-files" in which one will find xml/java classes or Android resources can be JAR or other format like that (EPUB/Office).

Security considerations

Zip archives are actually containers containing compressed files; they may include executables, scripts, Microsoft Office files having macros in them, setup files, disk imaging files, or shortcut files. In particular, a self-extracting Zip file is actually an executable stub file typically represented by the portable-executable (PE) program having an MZ header, implying all the typical risks posed by .EXE, such as potentially having embedded malware, so always confirm signatures from publishers of software. A Zip bomb or deeply-nested ZIP can inflate a small file downloaded to become many files or large storage demands, hence it is important to preview the expected sizes as well as extracting such archive files under a constrained quota. Path traversal or zip slip takes advantage of path naming conventions such as ../ target name or full path names in attempting to place files outside the extraction destination folder.

History and versions

ZIP originated from PKWARE's development of PKZIP, introduced in 1989 by Phil Katz after legal disputes with SEA regarding the ARC archive format, with "zip" implying speed -PKZIP offered faster compressions and decompressions than most competing PC archives at the time. Info-ZIP distributed its open and cross-platform zip/unzip binaries in the 1990s; PKWARE's PKZIP v2.0 of 1993 made the Deflate compression algorithm compatibility norm. ZIP has become a Java packaging container format in 1997, with subsequent containers using it for similar reasons of convenience and efficiency in random file accesses and single-file compression. The ZIP64 improvements later removed the limitation of only 4 GiB size per archive and 65k files inside. The APPNOTE is issued further by PKWARE, and ISO/IEC 21320-1 standard of 2015 defines interoperable subset. Built-in ZIP support arrived in Windows Me and Windows XP, and it was natively supported by macOS and Linux desktop shells. The widespread use now involves OOXML, EPUB, JAR, APK and other packages.

7z archives normally produce more compression efficiency as compared to ZIP, given that 7-Zip uses LZMA and LZMA2, and it can apply AES-based encryption. But, unlike ZIP, 7z format is not much supported by the native OS. The formats that RAR provide include strong data compression ability, recovery record features, and part numbers, where the file has the structure part1.rar etc. Creating RAR files requires WinRAR, which makes ZIP a much easier method for creating an archive. On Unix, there exists the popular format .tar, .tar.gz, .tgz: tar preserves Unix data and directory hierarchy; the use of gzip compresses the whole stream into a form that does not offer the possibility of random access to an individual member in the stream unlike that of the ZIP archive format. Generally the gz and bz2 formats compress a single stream, meaning tar is usually used with them. .cab exists in Microsoft installations and other Windows elements. ZIP-based packages include .jar, .docx, .xlsx, .pptx and .apk.

Comments (0)

Replying to

No comments yet. Be the first to share your experience with this file type.