Base64 guide

Base64 newline issue and invalid symbol 10

A newline pasted into a Base64 value can look invisible, but strict decoders may reject it as a real character.

Open Base64 Error Fixer View all tools

Why newline characters break decoding

Command-line tools, email clients, and old MIME-style output may wrap long Base64 strings across several lines. Some decoders skip that whitespace. Others treat the line break as data and fail with messages such as invalid symbol 10, because a line feed is byte value 10.

Example

Input

SGVsbG8s
IDEwMjRiYXNl

Output

SGVsbG8sIDEwMjRiYXNl decodes to Hello, 1024base.

How to clean newline-wrapped Base64

  1. Check where the value came from: terminal output, email, PEM-style wrapping, JSON, or a log line.
  2. Join wrapped lines back together without changing the order of the encoded characters.
  3. Keep any equals-sign padding at the very end after the lines are joined.
  4. Decode the single-line value before pasting it into a request header, config file, or script.

Rust and strict decoder errors

Rust Base64 libraries report the byte that failed. Symbol 10 means a line feed. Symbol 61 points at an equals sign. Symbols 45 and 95 point to dash and underscore, which belong to Base64URL.

For copied tokens, fix the wrapper first: trim external whitespace, remove accidental line wrapping, then decode one clean line.

Encoding without accidental line breaks

For environment variables, HTTP headers, and compact JSON fields, generate one line. Many command-line tools have a no-wrap option, and shell commands such as echo may add a final newline unless you choose the no-newline form.

Wrapped Base64 is fine in formats built for it. It is a nuisance in pasted code because one hidden line break can be the whole bug.

Common mistakes

  • Leaving a final newline copied from echo or a shell pipeline
  • Removing real encoded characters while trying to delete whitespace
  • Assuming every decoder ignores whitespace by default
  • Mixing wrapped Base64 text with surrounding JSON quotes or commas

Related problems

FAQ

What does invalid symbol 10 mean in Base64?

It means the decoder found byte 10, a line feed character. Remove accidental newlines or choose a decoder mode that accepts wrapped input.

Are newlines valid in Base64?

Wrapped Base64 exists, but not every decoder accepts it. Single-line text is less fragile for headers, tokens, and config values.

Can I remove all whitespace before decoding?

For wrapped Base64 text, yes. First make sure the whitespace is not part of surrounding JSON, a label, or another format.