Base64 Chunk Joiner – Free

Paste Base64 chunks one per line and this Base64 chunk joiner rebuilds a single valid string. Choose whether the lines are slices of one encoding or blocks that were each encoded on their own.

How to use the Base64 Chunk Joiner tool

  1. Paste the pieces into Chunks, one per line, keeping them in their original order. Blank lines are ignored.
  2. Under Chunk format, pick Slices of one Base64 sequence if one long string was cut into pieces.
  3. Pick Independently encoded blocks if every line came from a separate encode call and may end in its own = padding.
  4. Select Join chunks, or select Example to join the two sample lines.
  5. Copy the joined Base64 from the Result box.

Two ways Base64 gets chunked

Chunked Base64 comes in two kinds that look alike and behave differently. In the first, a sender encodes the whole file once and then cuts the text into lines, as MIME email and PEM files do. In the second, the sender reads the file in binary pieces and encodes each piece separately, which is common in streaming audio and chunked upload APIs.

The difference matters because Base64 works in groups of 3 bytes. A separately encoded block whose byte length is not a multiple of 3 ends with padding or leftover bits. Concatenating such blocks as text puts padding in the middle of the string or shifts every later character group, and a decoder then rejects the value or returns wrong bytes.

What each Chunk format option does

Slices of one Base64 sequence concatenates the lines, decodes the result once and encodes it again. Independently encoded blocks decodes every line by itself, appends the byte arrays in order and encodes the combined bytes once. In both modes the output is standard Base64 with + and / and correct padding, on a single line.

  • A data URL header is stripped: once at the start in slice mode, on every line in block mode.
  • URL-safe input with - and _ is accepted. In block mode each line may use a different alphabet.
  • Missing padding is tolerated, but when = is present the length must be a multiple of 4.
  • Any invalid chunk stops the run with Enter valid Base64, so a damaged piece never yields a silently wrong result.

Worked example: joining padded Base64 blocks

Take two blocks that each encode the two bytes of Hi. As text both are SGk=. Slice mode joins them into SGk=SGk=, which is invalid because padding appears before the end, and the tool reports an error. Block mode decodes both lines to Hi, joins the bytes into HiHi and encodes that.

The opposite case also exists. The lines SGVsb, G8sIHd and vcmxk are slices cut at arbitrary points. Slice mode returns SGVsbG8sIHdvcmxk, while block mode fails because a 5-character line cannot be decoded alone.

SGk=
SGk=

Slices of one Base64 sequence  ->  Enter valid Base64.
Independently encoded blocks   ->  SGlIaQ==

Common reasons a joined string is wrong

Order is the usual culprit. The tool joins lines top to bottom and cannot know that chunk 7 arrived before chunk 6, so sort by sequence number first. A missing chunk is the next most likely cause. If the chunk lengths are multiples of 4, neither mode can see the gap, and the output is valid Base64 for an incomplete file.

Also remove JSON quotes, commas and field names before pasting, so that only Base64 text is on each line.

Frequently asked questions

How do I know which chunk format my data uses?

Look at the line endings. If lines other than the last end with =, they are independently encoded blocks. If every line except the last has the same length and none has padding, they are probably slices. When no line before the last has padding and all lengths are multiples of 4, both options return the same string.

Can I just delete the line breaks to join Base64?

Only for slices of one sequence. Removing line breaks between blocks that were encoded separately leaves padding or partial groups inside the string, and decoders fail or return corrupted bytes. Use Independently encoded blocks for that case.

Does it accept URL-safe Base64 chunks?

Yes. Lines using - and _ are detected and decoded. The joined output is always written in the standard alphabet with padding, so convert it afterward if the destination needs the URL-safe form.

Is the pasted data uploaded anywhere?

No. Joining happens in the page with JavaScript. The chunks and the joined string remain in your browser tab.

Related tools