CRC Calculator

CRC64 Calculator

Calculate a 64-bit CRC for text, hex bytes or a file of any size. The default is CRC-64/XZ; the table below the calculator shows every CRC-64 variant for the same input, with the parameters that set them apart.

9 bytes
Parameters

ResultCRC-64/XZ

0x995DC9BBDF1939FA
Decimal
11051210869376104954
Binary
1001100101011101110010011011101111011111000110010011100111111010
Bytes, big-endian
99 5D C9 BB DF 19 39 FA
Bytes, little-endian
FA 39 19 DF BB C9 5D 99

Check value for "123456789": 0x995DC9BBDF1939FA

Source code for this CRC

Generated for the parameters above. Bit-by-bit and table-free, so it is easy to port to a microcontroller.

#include <stddef.h>
#include <stdint.h>

uint64_t crc_64_xz(const uint8_t *data, size_t len)
{
    uint64_t crc = UINT64_C(0xFFFFFFFFFFFFFFFF);
    while (len--) {
        crc ^= *data++;
        for (int i = 0; i < 8; i++)
            crc = (crc & 1) ? (crc >> 1) ^ UINT64_C(0xC96C5795D7870F42) : crc >> 1;
    }
    return crc ^ UINT64_C(0xFFFFFFFFFFFFFFFF);
}

All CRC algorithms for this input

Click a row to load its parameters into the calculator.

AlgorithmResultPolyInitRefInRefOutXorOutCheckUsed in
0x6C40DF5F0B4973470x42F0E1EBA9EA36930x0000000000000000falsefalse0x00000000000000000x6C40DF5F0B497347DLT-1 tape cartridges
0x995DC9BBDF1939FA0x42F0E1EBA9EA36930xFFFFFFFFFFFFFFFFtruetrue0xFFFFFFFFFFFFFFFF0x995DC9BBDF1939FAxz / LZMA2 containers
0xB90956C775A410010x000000000000001B0xFFFFFFFFFFFFFFFFtruetrue0xFFFFFFFFFFFFFFFF0xB90956C775A41001ISO 3309, Go hash/crc64 ISO table
0x62EC59E3F1A4F00A0x42F0E1EBA9EA36930xFFFFFFFFFFFFFFFFfalsefalse0xFFFFFFFFFFFFFFFF0x62EC59E3F1A4F00AWolfgang Ehrhardt library
0x75D4B74F024ECEEA0x259C84CBA64263490xFFFFFFFFFFFFFFFFtruetrue0x00000000000000000x75D4B74F024ECEEAMicrosoft MS-FCIADS
0xE9C6D914C4B8D9CA0xAD93D23594C935A90x0000000000000000truetrue0x00000000000000000xE9C6D914C4B8D9CARedis RDB files
0xAE8B14860A7998880xAD93D23594C936590xFFFFFFFFFFFFFFFFtruetrue0xFFFFFFFFFFFFFFFF0xAE8B14860A799888NVMe, Amazon S3 checksums

The CRC64 variants and their parameters

A 64-bit CRC is the usual choice once data gets large enough that a 1-in-4-billion miss rate is no longer comfortable: archive formats, storage systems, object stores. As with the shorter CRCs, the name alone does not identify the algorithm. The check value is the CRC of the ASCII string 123456789.

VariantPolynomialInit / XorOutReflectedCheckUsed in
CRC-64/XZ42F0E1EBA9EA3693all ones / all onesyes995DC9BBDF1939FAxz, 7-Zip, Go crc64.ECMA
CRC-64/ECMA-18242F0E1EBA9EA3693zero / zerono6C40DF5F0B497347DLT-1 tape cartridges
CRC-64/NVMEAD93D23594C93659all ones / all onesyesAE8B14860A799888NVMe, Amazon S3
CRC-64/GO-ISO000000000000001Ball ones / all onesyesB90956C775A41001ISO 3309, Go crc64.ISO
CRC-64/REDISAD93D23594C935A9zero / zeroyesE9C6D914C4B8D9CARedis RDB files
CRC-64/MS259C84CBA6426349all ones / zeroyes75D4B74F024ECEEAMicrosoft file formats

Reflected implementations store the polynomial bit-reversed. If your source code contains 0xC96C5795D7870F42, that is 0x42F0E1EBA9EA3693 reversed — the XZ variant. 0xD800000000000000 is the ISO polynomial reversed.

CRC64 in code

CRC-64/XZ, bit by bit, in C:

uint64_t crc64_xz(const uint8_t *data, size_t len)
{
    uint64_t crc = UINT64_C(0xFFFFFFFFFFFFFFFF);
    while (len--) {
        crc ^= *data++;
        for (int i = 0; i < 8; i++)
            crc = (crc & 1) ? (crc >> 1) ^ UINT64_C(0xC96C5795D7870F42)
                            : crc >> 1;
    }
    return crc ^ UINT64_C(0xFFFFFFFFFFFFFFFF);
}

The same in Go, using the standard library table:

table := crc64.MakeTable(crc64.ECMA)
sum := crc64.Checksum([]byte("123456789"), table) // 0x995dc9bbdf1939fa

Python has no CRC64 in its standard library; the generated Python under the calculator runs as is. In JavaScript a 64-bit value does not fit in a number, so the generated code uses BigInt.

Test vectors

InputCRC-64/XZCRC-64/ECMA-182CRC-64/NVME
123456789995DC9BBDF1939FA6C40DF5F0B497347AE8B14860A799888
hello9B1EDAE5DBB937B140544A306137B6EC3377857006524257

When 64 bits is worth it

  • Very large objects. Every block you check is another chance for a 32-bit CRC to miss an error. Across petabytes of storage that adds up; 64 bits removes the concern.
  • Content fingerprints. As a fast, non-cryptographic fingerprint for change detection, 64 bits keeps accidental collisions rare into the billions of items.
  • Not for short frames. On a 20-byte packet, eight bytes of CRC is 40% overhead. Use the CRC16 calculator or CRC8 calculator for those, and the CRC32 calculator for general files and network frames.

To check a download against several algorithms at once, the file checksum calculator computes CRC-64/XZ and CRC-64/NVME alongside CRC32 and SHA-256.

Frequently asked questions

What is CRC64?

CRC64 is a cyclic redundancy check with a 64-bit result. It works exactly like CRC32 but with a 65-bit generator polynomial, which makes an undetected error about four billion times less likely. Several variants exist; the most common are CRC-64/XZ, CRC-64/ECMA-182 and CRC-64/NVME.

What is the difference between CRC-64/ECMA-182 and CRC-64/XZ?

They share the polynomial 0x42F0E1EBA9EA3693 but nothing else. ECMA-182 is not reflected and uses zero for the initial value and final XOR; its check value is 0x6C40DF5F0B497347. CRC-64/XZ is reflected and uses all ones for both; its check value is 0x995DC9BBDF1939FA. Most software that says "CRC-64 ECMA" today, including Go and xz, actually computes the XZ variant.

Which CRC64 does Amazon S3 use?

CRC-64/NVME: polynomial 0xAD93D23594C93659, reflected, initial value and final XOR all ones. S3 reports it Base64-encoded in the x-amz-checksum-crc64nvme header, so convert the hex result to Base64 before comparing.

Is CRC64 better than CRC32?

For detecting accidental corruption in large files, yes: with 64 bits the chance of a random error going unnoticed is about 1 in 18 quintillion, against 1 in 4.3 billion for CRC32. It costs four extra bytes and is slightly slower. Like every CRC it offers no protection against deliberate tampering — use SHA-256 for that.

Can CRC64 be used as a unique ID or hash key?

With care. Among randomly chosen inputs, a collision becomes likely (50%) at around five billion items, so it is adequate for deduplication hints and hash tables of moderate size. It is not safe where someone could craft colliding inputs on purpose.