Back

Blog details

How IPFS Splits Files: Fixed vs. Content-Defined Chunking

AIOZ Network
7 min readAugust 23, 2026
aioz-pin
AIOZ Pin knowledge hub cover: How IPFS splits files with fixed-size and content-defined chunking

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:

  • The default chunker is fixed size: every block is 262,144 bytes (256 KiB) except the last. In Kubo that's Import.UnixFSChunker = size-262144.
  • Insert one byte near the start of a 10 MiB file: fixed-size chunking changed all 40 blocks and shared 0 with the original, while a Rabin chunker kept 29 of 30 (a run for this post).
  • Rabin and Buzhash cut where a rolling hash matches a pattern, so boundaries realign after an edit and most blocks deduplicate.
  • You choose with 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.

What is chunking in IPFS?

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: fixed-size chunking

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.

Why does one edit change every block?

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.

Diagram comparing fixed-size and content-defined chunking after one inserted byte: all six fixed-size blocks change, while only the first content-defined block changes

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.

How does content-defined chunking work?

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:

  • Rabin uses Rabin fingerprinting. Give it one average size and it derives the bounds: a minimum of a third of the average and a maximum of 1.5 times it. Or you set all three yourself. The minimum must be greater than 16 bytes.
  • Buzhash uses a cyclic polynomial hash with fixed bounds: blocks are at least 128 KiB and at most 512 KiB. You can't tune it from the command line.

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.

Choosing an ipfs add --chunker option

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 buzhash

Two 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.

How to choose a chunker

Work down this list:

  1. Do you need the same CID for the same file across tools and releases? Use fixed size, the 256 KiB default or the 1 MiB unixfs-v1-2025 profile. Only fixed size carries that promise.
  2. Does the file stay as it is, or only grow at the end? Stay with fixed size, because appending leaves every earlier block unchanged.
  3. Do you store many versions of a large file that change in the middle, such as datasets, disk images or archives? Try Rabin or Buzhash, and count shared blocks between two real versions before you switch, as the 10 MiB run above did.

How the chunker changes a file's CID

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.

How AIOZ Pin handles chunking

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.

Frequently Asked Questions

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.

References

We only send updates when meaningful changes ship, and you can unsubscribe anytime

Related Content

blog thumbnail

ENS IPFS Contenthash: Point an .eth Name at a Website

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.

7 min readDecember 04, 2026
blog thumbnail

ERC-721 Metadata JSON: Fields, Images and ipfs:// URIs

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

8 min readDecember 02, 2026
blog thumbnail

Merkle DAG vs Merkle Tree: What IPFS Changes and Why

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.

8 min readNovember 30, 2026
blog thumbnail

What Is IPNI? How the IPFS Network Indexer Finds Providers

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

8 min readNovember 27, 2026
blog thumbnail

On-Chain vs Off-Chain NFT Metadata: Where the Data Lives

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.

6 min readNovember 25, 2026
blog thumbnail

What Is a Kademlia DHT? The Routing Algorithm Behind IPFS

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.

6 min readNovember 23, 2026