Convert GZ to TAR.GZ — Free Online Converter
Convert Gzip Compressed Archive (.gz) to Gzipped Tar Archive (.targz) online for free. Fast, secure archive conversion with no watermarks or registration.
安全传输
HTTPS 加密上传
隐私优先
文件处理后自动删除
无需注册
即刻开始转换
随处可用
任何浏览器,任何设备
如何转换
Upload your .gz file by dragging it into the upload area or clicking to browse.
Choose your output settings. The default settings work great for most files.
Click Convert and download your .tar.gz file when it's ready.
关于GZ转TAR.GZ
GZ (Gzip) compresses a single file using the DEFLATE algorithm. A bare .gz file wraps exactly one compressed data stream — it does not bundle multiple files or preserve directory structure on its own. TAR.GZ (tarball) combines the TAR archiver with gzip compression, creating a single compressed archive that contains a full file tree with directory structure, permissions, and metadata.
Converting a standalone .gz file to a proper .tar.gz wraps the decompressed content in a tar archive before recompressing with gzip. This transforms a single compressed file into a standards-compliant tarball that follows the conventions expected by package managers, build systems, and source distribution platforms. If the .gz already wraps a tar archive, this conversion normalizes the output filename and structure.
为什么要将GZ转换为TAR.GZ?
Many tools and platforms distinguish between bare .gz files and proper .tar.gz tarballs. Package managers (npm, pip, gem) expect .tar.gz files with specific internal structure. Build systems look for tarballs, not standalone compressed files. GitHub release assets conventionally use .tar.gz format with a top-level project directory.
A bare .gz file also loses all metadata beyond the filename — there are no permissions, no timestamps beyond mtime, and no directory structure. Wrapping the content in TAR before gzip compression adds proper metadata preservation. This makes the output self-documenting and suitable for distribution contexts where a bare compressed file would be ambiguous or insufficient.
常见使用场景
- Converting standalone .gz compressed files into proper tarballs expected by package managers
- Normalizing .gz files into standard .tar.gz format for consistent archive handling in pipelines
- Wrapping single compressed files in tar to preserve metadata (permissions, ownership, timestamps)
- Preparing .gz assets as conventional source distribution tarballs for open-source release
- Ensuring archive format compliance for build systems that specifically require .tar.gz input
工作原理
The gzip stream is decompressed to recover the original file data. A POSIX tar archive is created containing the decompressed file as a single entry (or multiple entries if the original .gz contained tar data). The tar stream is then compressed with gzip at the standard compression level. The output follows the conventional .tar.gz structure: tar header blocks (512 bytes each with filename, size, permissions, timestamps, checksum) followed by file data blocks, all wrapped in a gzip DEFLATE stream with CRC32 verification.
质量与性能
Completely lossless. The file content from the original .gz is preserved byte-for-byte in the .tar.gz output. The tar layer adds metadata (permissions, timestamps, ownership) without altering the actual file data. The gzip compression is reapplied to the tar stream, producing the same DEFLATE-compressed output with identical decompressed content.
设备兼容性
| Device | GZ | TAR.GZ |
|---|---|---|
| Windows PC | Partial | Partial |
| macOS | Partial | Partial |
| iPhone/iPad | Partial | Partial |
| Android | Partial | Partial |
| Linux | Partial | Partial |
| Web Browser | No | No |
获得最佳效果的技巧
- 1This conversion is most useful when a pipeline or tool specifically requires .tar.gz format but your source is a bare .gz file
- 2For source code releases, ensure the tarball has a top-level directory (e.g., project-1.0/) rather than loose files at the root
- 3The size difference between .gz and .tar.gz for single files is negligible — the tar overhead is only a few hundred bytes
- 4Use `tar -tzf output.tar.gz` to verify the internal structure matches your expectations
- 5If you already have a .tar.gz and just want to rename to .tgz (or vice versa), no conversion is needed — they are the same format
相关转换
GZ to TAR.GZ conversion wraps standalone gzip-compressed files in a proper tar archive, adding metadata preservation and standards compliance for distribution platforms, build systems, and package managers.
GZ 与 TAR.GZ 对比
| 特性 | GZ | TAR.GZ |
|---|---|---|
| 全称 | Gzip Compressed File | Gzipped Tar Archive |
| 扩展名 | .gz | .tar.gz |
| 最适合 | DEFLATE compression | TAR + gzip |