“Invalid Base64” is one of the most frustrating errors in development, because the value usually looks fine. After analysing the kinds of broken values people paste into our decoder, we built a tool that fixes them automatically: the Base64 repair tool.
What breaks Base64?
Base64 is designed to survive text channels, but the channels themselves often transform it:
- Line breaks and spaces inserted by e-mail clients, terminals and editors.
- JSON escaping:
\/instead of/,\nsequences, or\u003dinstead of=. - URL encoding:
%2B,%2F,%3D— and worse,+turned into a space by form decoding. - Base64URL characters (
-,_) where standard Base64 was expected. - Prefixes and wrappers:
data:image/png;base64,, quotes, PEM header lines. - Missing or excess padding after copying part of a value.
How the repair tool works
The tool applies a series of safe transformations in a careful order (for example, it URL-decodes before replacing spaces with +), then validates the result. Every change is listed, so you can see exactly what was wrong with your data — useful for fixing the bug at its source.
The output is canonical standard Base64 that any decoder accepts. If the original was truncated, the missing bytes cannot be recovered, but everything before the cut decodes correctly.
Try it
Paste something like this into the repair tool:
"data:text/plain;base64,SGVsbG8g\nV29ybGQ%3D"
The tool removes the quotes, the data URI prefix, the escaped line break and the percent-encoded padding, and returns SGVsbG8gV29ybGQ= (“Hello World”). Then check the result with the validator. As always, everything runs in your browser.
댓글 (0)
“Launched: the Base64 repair tool”에 대한 질문, 아이디어, 버그가 있으신가요? 댓글을 남기거나 도구를 평가하거나 다른 사람에게 답글을 달아 주세요.
아직 댓글이 없습니다. 첫 번째로 의견을 남겨 주세요!