How to use the Base64 Encoder / Decoder
- 1Choose Encode or Decode.
- 2Paste text or pick a file.
- 3Copy the result.
About the Base64 Encoder / Decoder
Base64 represents binary data using printable characters. It's used in data URIs, email attachments, JWTs and APIs.
This tool handles Unicode correctly, supports URL-safe Base64 and can convert files into data URIs.
When to use the Base64 Encoder / Decoder
Inspecting encoded text in API fields
An API may return a Base64 field whose contents are actually a short text document or message. Switch to Decode and paste the field value to inspect its UTF-8 contents. This is useful for understanding a response format, but it does not verify a signature or prove that the decoded content is authentic.
Embedding a small asset as data
For a self-contained prototype, you may want an asset represented directly in markup instead of referenced by a separate file path. Select the file encoding option to produce a complete data URI. Copy that output into a compatible location, then check rendering and document size before deciding whether embedding is appropriate.
Preparing Unicode text for encoded transport
A system accepting Base64 text may receive names, symbols, or emoji rather than only ASCII characters. The encoder converts input to UTF-8 bytes before creating Base64, preserving those characters through a compatible decode. Enable URL-safe output when the receiving format specifically expects the alternative alphabet and omitted trailing padding characters.
Tips and best practices
- Choose URL-safe encoding only when the receiving format requests it. This option replaces plus and slash characters and removes trailing equals signs from encoded text.
- Strip a data URI's metadata prefix before attempting text decoding. The decoder expects Base64 content, not an entire data URI beginning with a media type.
- Use file encoding for binary assets, but do not expect Decode to export arbitrary binary files. Decoded bytes must form valid UTF-8 text for this interface.
- Account for Base64 expansion when embedding assets. The encoded payload is roughly one-third larger than its original bytes, with additional overhead for a data URI prefix.