
IPFS chunking is the step that cuts a file into blocks before they become a Merkle DAG. By default, Kubo cuts fixed 256 KiB blocks. It also ships two content-defined chunkers, Rabin and Buzhash, which pick cut points from the data. That choice decides how many blocks survive an edit.
TL;DR:
Import.UnixFSChunker = size-262144.ipfs add --chunker=size-N, rabin-..., or buzhash. Only fixed size promises the same CID for the same data across releases.Updated Nov 25, 2026: removed an unverifiable claim, added a run on one 10 MiB file and a choice path, and tightened the ending.
When you add a file, IPFS doesn't store it as one object. It splits the bytes into chunks, hashes each chunk into a block, and links the blocks under a root node (UnixFS). The root's hash becomes your CID. So a 10 MiB file with the default chunker becomes 40 leaf blocks of 256 KiB each, plus the node that links them.
Chunking happens once, when the file is added. After that, the blocks are what gets stored, deduplicated, and fetched from peers, along the path from file to Merkle DAG to content routing.
The default splitter reads 262,144 bytes, makes that one block, and repeats until the file runs out, so the final block holds whatever is left. In the Go library boxo/chunker, this is DefaultSplitter, built on NewSizeSplitter with DefaultBlockSize = 1024 * 256.
Fixed size is fast, since no hash runs per byte, and every block but the last has the same size, which makes storage easy to predict. It is also deterministic, which matters for CIDs, as a later section shows.
Kubo also has an import profile, unixfs-v1-2025, with 1 MiB fixed chunks, CIDv1 and raw leaves, meant for new projects that need the same CID across IPFS implementations (IPIP-499). You turn it on with ipfs config profile apply unixfs-v1-2025.
This is the byte-shifting problem: insert a single byte near the start of a large file and add it again, and every boundary after the insert moves by one byte. Each later block then holds different bytes and hashes differently.

In a run for this post, the input was 10 MiB (10,485,760 bytes) of seeded pseudo-random data, and then the same data with one byte inserted at offset 1,000. The fixed 256 KiB chunker cut the original into 40 blocks and the edited file into 41, and 0 of the 41 matched an original block. One changed byte in 10,485,761 meant storing 10 MiB again.
Appending is the friendly case: if you only add bytes at the end, every earlier fixed-size block stays identical and only the last one or two change.
Content-defined chunkers don't count bytes: they slide a rolling hash over the data and cut wherever it matches a pattern. Since the cut points come from the content, an insert only disturbs the boundary near the edit, and further along the chunker finds the same patterns in the same bytes, so the boundaries line up again.
On the same 10 MiB file and the same inserted byte, Rabin gave a different result. The Rabin chunker came from the ipfs-unixfs-importer 17.1.1 library, with an average of 262,144 bytes and bounds of 131,072 and 524,288. It cut 30 blocks before the edit and 30 after, and 29 matched. This is that library's Rabin, not Kubo's, and random bytes show the mechanism, not the saving on your data.
Kubo ships two of these:
The trade-off is predictability: boundaries survive edits, but block sizes vary within a range, and hashing every byte costs more CPU than counting to 262,144. More, smaller blocks also mean more requests when someone fetches the file, one factor in what determines IPFS retrieval speed.
The --chunker flag (short form -s) sets the algorithm for one ipfs add. It accepts size-[bytes], rabin-[min]-[avg]-[max] or buzhash (Kubo CLI reference), and the boxo parser also accepts plain rabin and rabin-[avg]. The commands below follow those docs and were not run (no IPFS binary here).
# Default: fixed-size 256 KiB chunks (Import.UnixFSChunker = size-262144)
ipfs add photo.tar
# Fixed size, explicit byte count (1 MiB here)
ipfs add --chunker=size-1048576 photo.tar
# Rabin: one value sets the average, min and max are derived from it
ipfs add --chunker=rabin-262144 photo.tar
# Rabin with explicit min, average, and max
ipfs add --chunker=rabin-131072-262144-524288 photo.tar
# Buzhash, fixed internal bounds
ipfs add --chunker=buzhash photo.tar
# Make a chunker the node default
ipfs config Import.UnixFSChunker buzhashTwo limits apply: a size- value or a Rabin maximum can't exceed 2 MiB minus 256 bytes (2,096,896 bytes), so blocks stay inside the Bitswap 2 MiB block limit, and Buzhash has its own 512 KiB cap.
Work down this list:
unixfs-v1-2025 profile. Only fixed size carries that promise.Different boundaries give different blocks, a different DAG, and so a different root CID. The same file added with size-262144 and with buzhash gets two CIDs, which is one reason the same file can get different CIDs in different tools.
Only the fixed-size chunker guarantees the same CID for the same data: Rabin and Buzhash may change their internal parameters in a future Kubo release. If someone must rebuild your CID from the raw file later, the exact parameters matter, so use fixed size.
The chunker decides the CID, so choose it before you add the file, not after. AIOZ Pin's upload route, POST /api/pinning, takes a file and returns a CID. POST /api/pinning/pinByHash takes a CID you already made. Use the second when the chunker matters: add the file on your own Kubo node with the --chunker you want, then hand AIOZ Pin the CID.
With the remote service set up as in the Pinning Service API guide, the pair of commands looks like this (not run here):
ipfs add --chunker=buzhash --cid-version=1 dataset-v2.tar
ipfs pin remote add --service=pin --name=dataset-v2 <CID from the line above>Keep your node online until the pin shows pinned, because AIOZ Pin has to fetch the blocks from it. The Pin by CID docs show the same request over HTTP.
What is the default IPFS chunk size? 262,144 bytes (256 KiB) per block, except the last block of a file. Kubo stores it as Import.UnixFSChunker = size-262144. The unixfs-v1-2025 profile switches to 1 MiB.
What is the byte-shifting problem? With fixed-size chunks, inserting or deleting bytes moves every boundary after the edit. Most later blocks then hash differently, even though most content is unchanged.
What is content-defined chunking? A method that cuts where a rolling hash over the data matches a pattern, instead of at a fixed byte count. Boundaries realign after an edit, so most blocks stay the same.
How do I change the chunker in IPFS? Pass --chunker to ipfs add, for example --chunker=buzhash or --chunker=rabin-262144. To change the default, set Import.UnixFSChunker with ipfs config.
What is the largest chunk size IPFS allows? 2,096,896 bytes (2 MiB minus 256 bytes) for size- and the Rabin maximum. Buzhash is capped at 512 KiB.
Can I choose the chunker when I pin on AIOZ Pin? Add the file on your own node with --chunker, then pin the resulting CID with pinByHash.

An ENS IPFS contenthash points your .eth name at a site on IPFS. See the byte format, a real encoding, ipfs vs ipns records, gas used, and common mistakes.

ERC-721 metadata JSON explained: the three fields EIP-721 defines, OpenSea attributes and animation_url, ipfs:// image links, and folder CIDs for collections.

Merkle DAG vs Merkle tree explained: a tree gives each node one parent and short proofs, while the DAG IPFS uses shares blocks, carries data and links by CID.

IPNI is the IPFS network indexer behind cid.contact. See how index providers publish signed advertisement chains and how one HTTP query finds providers.

On-chain vs off-chain NFT metadata: what the contract stores, what lives on IPFS or a web server, what each costs in gas, and how to check any token yourself.

A Kademlia DHT finds peers by XOR distance. See how k-buckets, k = 20 and iterative lookups let IPFS locate who holds a CID, and how to watch it on Kubo.