Base64
Encode text or file bytes; decode Base64 text
Paste text, Base64, or a Data URL and convert it first to inspect encode/decode output; drop a file to encode its bytes. Auto is a heuristic; select the direction when uncertain.
The full guide also includes pitfalls, worked examples, snippets, FAQs, and related tools for checking results or troubleshooting.
About this tool
Choose Encode to preserve the exact text, including spaces, or drop a file to encode its original bytes once. Decode accepts standard and URL-safe alphabets, optional padding, whitespace, and Base64 Data URLs. It displays valid UTF-8 text or a recognized PNG, JPEG, GIF, or SVG preview. Other binary data is not exported as a file. Auto mode uses a string-shape heuristic; select the direction explicitly when a value could be either plain text or Base64. Conversion runs locally and does not save input drafts.
Suggested Workflow
API Debugging Checklist: From Broken Response to Root Cause
A practical debugging flow for API payload errors, auth failures, and malformed responses.
Choose an ID Format and Verify Its Encoding Contract
Compare UUID v7 and NanoID use cases, reproduce A β QQ== or A β 28, and distinguish byte encoding from numeric ID conversion and authentication.
Base64 Decoding: Reproduce UTF-8, URL-safe, Padding, and Data URL Cases
Use known inputs and outputs to separate Base64 errors from URL escaping, short-input auto detection, and binary data displayed as text.
Production Snippets
Preserve spaces and distinguish file bytes
text
Encode text: " x " β IHgg
Drop a file containing bytes 00 ff 01 β AP8B
Decode: IHgg β " x "
Auto is a heuristic; choose the mode explicitly.Frequently Asked Questions
Does Base64 encrypt data?
No. It represents bytes as text and is reversible. It provides no confidentiality or authenticity.
Can I generate URL-safe Base64?
The encoder produces standard Base64 with padding. URL-safe - and _ are accepted when decoding, but there is no URL-safe output switch.
What do trailing = characters mean?
They pad the final Base64 block. Decoding accepts omitted padding, but rejects malformed alphabet, length, and explicit padding. Whitespace is ignored on decode.
Why can valid Base64 fail text decoding?
Its bytes may be binary or use a different character encoding. Non-UTF-8 data is rejected instead of replaced with garbled text, except recognized image previews.
Does Auto know my intended direction?
No. A plain alphanumeric string can resemble Base64. Choose Encode or Decode explicitly to avoid an unintended conversion.
Keep browsing