CRC32 Calculator
Compute CRC32 checksum of text for error detection and data integrity verification.
Back to all tools on ToolForge
CRC32 Result
About CRC32 Calculator
This CRC32 calculator computes the 32-bit Cyclic Redundancy Check checksum of any text input. CRC32 is widely used for detecting accidental data corruption in file transfers, archive verification, and network communications.
The calculation uses the standard CRC-32 polynomial (0xEDB88320) compatible with ZIP, PNG, GZIP, Ethernet, and many other formats.
How CRC32 Works
The CRC32 algorithm processes input data byte by byte:
- Initialize: Start with CRC = 0xFFFFFFFF (all bits set)
- Process each byte: XOR the byte with the lowest byte of CRC
- Table lookup: Use the result as index into a precomputed 256-entry table
- Update CRC: Shift CRC right 8 bits, XOR with table value
- Finalize: XOR final CRC with 0xFFFFFFFF to get result
CRC32 Algorithm Implementation
// Generate CRC32 lookup table
function makeCRCTable() {
const table = [];
for (let n = 0; n < 256; n++) {
let c = n;
for (let k = 0; k < 8; k++) {
c = (c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1);
}
table[n] = c;
}
return table;
}
// Calculate CRC32 checksum
function crc32(data) {
const table = makeCRCTable();
const bytes = new TextEncoder().encode(data);
let crc = 0 ^ (-1);
for (let i = 0; i < bytes.length; i++) {
crc = (crc >>> 8) ^ table[(crc ^ bytes[i]) & 0xFF];
}
return (crc ^ (-1)) >>> 0;
}
// Output as hexadecimal
const checksum = crc32("Hello World").toString(16);
// Output: "559d8f05"
CRC32 Use Cases
| Application | Purpose | Example |
|---|---|---|
| File Archives | Verify extracted files match originals | ZIP, RAR, 7Z checksums |
| Image Formats | Detect PNG file corruption | PNG chunk CRC checks |
| Compression | Verify decompressed data | GZIP, ZLIB integrity |
| Network Protocols | Detect transmission errors | Ethernet frames, SATA packets |
| Database Systems | Page integrity verification | PostgreSQL page checksums |
| Backup Systems | Quick change detection | rsync file comparison |
CRC32 Checksum Examples
Input: "" (empty string) CRC32: 00000000 Input: "Hello World" CRC32: 559d8f05 Input: "The quick brown fox jumps over the lazy dog" CRC32: 414fa339 Input: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" CRC32: 360794d8 Input: "123456789" CRC32: cbf43926 (standard test vector)
CRC32 vs Other Checksums
| Algorithm | Bits | Speed | Use Case |
|---|---|---|---|
| CRC32 | 32 | Very Fast | Error detection, file integrity |
| MD5 | 128 | Fast | Legacy hash (deprecated for security) |
| SHA-1 | 160 | Moderate | Legacy hash (deprecated for security) |
| SHA-256 | 256 | Slower | Secure hashing, integrity verification |
| Adler32 | 32 | Fastest | ZLIB compression (less reliable than CRC32) |
Understanding CRC32 Output
- Format: 8 hexadecimal characters (0-9, a-f)
- Range: 00000000 to FFFFFFFF (0 to 4,294,967,295)
- Case: Typically lowercase, but case-insensitive for comparison
- Uniqueness: 2^32 possible values; collisions possible but unlikely for accidental changes
Limitations of CRC32
- Not cryptographically secure: Intentional collisions can be created
- Limited space: Only 32 bits means ~1 in 4 billion collision chance for random data
- Not reversible: Cannot recover original data from CRC32 alone
- No authentication: Does not verify data source, only integrity
Common Applications
- File Transfer Verification: Confirm downloaded files match source
- Archive Integrity: Verify ZIP/PNG/GZIP files haven't been corrupted
- Database Page Checks: Detect storage corruption in database pages
- Network Packet Validation: Ensure Ethernet frames arrived intact
- Backup Deduplication: Quick comparison to detect changed files
- Embedded Systems: Firmware image verification before flashing
Frequently Asked Questions
- What is CRC32 and how does it work?
- CRC32 (Cyclic Redundancy Check 32-bit) is an error-detecting algorithm that produces a 32-bit checksum. It treats input data as a large polynomial and divides it by a fixed generator polynomial (0xEDB88320). The remainder becomes the checksum. Any change in input data produces a different CRC32 value with high probability.
- What is CRC32 used for?
- CRC32 is used for: detecting data corruption in file transfers, verifying archive integrity (ZIP, GZIP, PNG), network packet error detection (Ethernet, SATA), checksum verification in backup systems, and quick data comparison. It's fast but not cryptographically secure.
- Is CRC32 secure for password hashing?
- No. CRC32 is not cryptographically secure. It's designed for error detection, not security. CRC32 can be easily reversed and collisions can be intentionally created. For passwords, use bcrypt, scrypt, Argon2, or PBKDF2. For integrity verification, use SHA-256 or HMAC.
- What is the CRC32 polynomial?
- The standard CRC32 polynomial is 0xEDB88320 (reversed representation of 0x04C11DB7). This is the CRC-32 polynomial used in IEEE 802.3, ZIP, PNG, and many other standards. The polynomial determines how bits are XORed during the calculation.
- How accurate is CRC32 for error detection?
- CRC32 detects all single-bit errors, all two-bit errors, all odd-numbered bit errors, and all burst errors up to 32 bits. For random errors, the detection rate is 99.99999997% (1 in 2^32 chance of undetected error). However, intentional collisions are easy to create.
- What is the difference between CRC32 and hash functions?
- CRC32 is for error detection (accidental changes), while cryptographic hashes (SHA-256, MD5) are for security (intentional tampering). CRC32 is faster but produces only 32 bits. Hash functions produce longer outputs (128-512 bits) and are collision-resistant but slower.