---
title: "Lossless Data Compression — AP CSP Definition & Exam Guide"
description: "Lossless compression shrinks file size while guaranteeing perfect reconstruction of the original data. Learn how AP CSP tests it against lossy compression."
canonical: "https://fiveable.me/ap-comp-sci-p/key-terms/lossless-data-compression"
type: "key-term"
subject: "AP Computer Science Principles"
---

# Lossless Data Compression — AP CSP Definition & Exam Guide

## Definition

Lossless data compression is a method of reducing file size without losing any information. It allows for perfect reconstruction of the original data.

## Related Study Guides

- [2.2 Data Compression](/ap-comp-sci-p/unit-2/data-compression/study-guide/21yLa92Ec2potY7nGQfu)

## Review

### Related Terms

- [LZW compression algorithm](/ap-comp-sci-p/key-terms/lzw-compression-algorithm): LZW compression algorithm is a specific type of lossless data compression that replaces repeated sequences with shorter codes.
- Compression ratio: Compression ratio measures how much smaller a compressed file is compared to its original size. A higher ratio indicates more effective compression.
- Huffman coding: Huffman coding is another popular technique for lossless data compression that assigns variable-length codes to different characters based on their frequency of occurrence.
