← Back to Guides

PDF Compression Algorithms

How FlateDecode and DCTDecode shrink massive documents into emailable attachments.

Deflating the Data

PDFs support multiple internal compression algorithms for different data types. Text streams and vectors are typically compressed using FlateDecode, which is essentially zlib/DEFLATE—the same algorithm used in ZIP files and PNG images.

Images within a PDF can use DCTDecode (JPEG compression) or JPXDecode (JPEG2000). A PDF is effectively an uncompressed structural shell containing highly compressed inner streams.

Common Mistakes

  • Trying to ZIP a PDF to make it smaller. Since the internal streams are already compressed (FlateDecode), zipping a PDF usually yields less than a 5% reduction.

Next Steps

Put this theory into practice. Use our client-side tools to inspect documents directly in your browser.

Open Developer Tools