A ZIP file is an archive format that packages one or more files and directories into a single file, conventionally identified by the .zip extension. ZIP can also compress the individual files stored within the archive, most commonly using the DEFLATE compression method, although the format supports multiple compression methods. It was originally associated with the PKZIP software ecosystem and became extremely widespread because it combined packaging, compression, portability and relatively straightforward random access.
A ZIP file therefore serves two related purposes: it can provide a single container for many filesystem objects, and it can reduce the size of those objects through compression. A ZIP archive can also contain files that are not compressed, so ZIP should not be defined as synonymous with "compressed data".
Internally, a ZIP archive consists of records describing individual archive members and their associated metadata. Each member has a filename and information describing its compressed and uncompressed sizes, compression method and other properties. ZIP archives traditionally use local file headers associated with individual entries and a central directory near the end of the archive that provides an index of the entries. The end-of-central-directory record allows software to locate and interpret the central directory efficiently. This structure helps archive programs enumerate the contents without decompressing every member. It also means that ZIP is substantially different from a simple concatenation of files: the archive contains explicit metadata defining its members and the information required to extract them.
ZIP's ability to compress entries independently has important practical consequences. A ZIP archive containing hundreds of files does not necessarily require the entire archive to be decompressed before one member can be extracted. Software can use the central directory to locate an individual entry and then decompress that entry as required. This makes ZIP convenient for software distribution and general file exchange. The compression ratio depends on the contents and algorithm.
Compressing already compressed JPEG images, MP4 videos or encrypted files may provide little benefit, whereas plain text, source code and repetitive structured data can often shrink substantially. ZIP can therefore be both an archive container and a compression mechanism, but its usefulness for a particular dataset depends on the characteristics of the stored files.
ZIP supports metadata associated with archive entries, including filenames, directory information and timestamps, with extensions and extra fields providing mechanisms for additional information. Preservation of Unix permissions, symbolic links and other platform-specific metadata depends on the ZIP implementation and the metadata fields it uses. This matters when moving files between operating systems because an archive created on one platform may not reproduce every filesystem property identically on another.
ZIP is therefore highly portable for ordinary files but should not automatically be assumed to preserve every filesystem feature. Archive tools can also use ZIP64 extensions for archives or individual files exceeding limits imposed by the original ZIP specification, allowing modern archives to handle very large datasets.
ZIP can support encryption and password-based protection, but the security characteristics depend strongly on the encryption method used. Traditional ZIP encryption is considered weak and should not be relied upon for serious confidentiality. Modern ZIP tools may support stronger encryption mechanisms such as AES-based approaches, but interoperability varies between applications. Encryption also does not inherently provide protection against malware contained within an archive. A ZIP file can carry executable programs, scripts, documents or other potentially dangerous content just like any other container. Security software and users should therefore treat ZIP archives as containers whose contents need appropriate validation rather than assuming that compression makes them safe.
ZIP became a major cross-platform exchange format because software for creating and extracting it is available on Windows, macOS, Linux and many other systems, often without requiring additional software for basic operations. Operating systems commonly integrate ZIP extraction into their graphical file managers, making it familiar to ordinary users. ZIP is widely used for software packages, document bundles, website assets, data exports and file attachments.
Its popularity also means that many programming libraries can read and create ZIP archives, although developers need to consider security issues such as directory traversal during extraction. An archive entry containing a path such as .. /../target can potentially cause files to be extracted outside the intended destination if extraction software does not validate paths safely.
ZIP differs from TAR in a fundamental architectural respect. TAR is primarily an archive format that concatenates representations of filesystem objects into a tar stream, whereas ZIP maintains independently described entries in an indexed archive structure and can compress each entry. TAR is commonly paired with external compression, producing combinations such as .tar.gz or .tar.xz. ZIP generally combines the archive and compression concepts into one familiar file format.
ZIP also differs from gzip, which is primarily a compression format rather than a general multi-file archive. A .gz file normally represents one compressed stream, whereas a .zip file can contain many separately represented members. These distinctions explain why commands and tools for tar, gzip and ZIP are not interchangeable despite all being associated with smaller or packaged data.
A ZIP file is consequently best understood as a portable archive container with optional per-entry compression and metadata. Its combination of broad compatibility, independent entries, central-directory indexing and common compression methods makes it useful for distributing and transferring collections of files. Its limitations include dependence on implementation-specific metadata handling, differing support for encryption features, archive-extraction security risks and potentially poor compression of already compressed data.
The .zip extension is only the conventional filename indicator; applications should still inspect the archive structure rather than trusting the name alone. ZIP remains important because it provides a standardised way to represent a collection of files as one transferable object without requiring users to understand the underlying filesystem layout.