Base64 Encoder / Decoder

Encode or decode Base64 text and files, UTF-8 safe.

100% freeNo sign-upInstant results

How to use the Base64 Encoder / Decoder

  1. 1Choose Encode or Decode.
  2. 2Paste text or pick a file.
  3. 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.

Frequently asked questions

No. Base64 is an encoding, not encryption — anyone can decode it.

No. This tool runs entirely in your browser using JavaScript. Your input never leaves your device, which makes it safe for confidential content.

Base64 can represent any bytes, including image data and other binary formats. This decoder additionally requires those bytes to be valid UTF-8 text. A correctly encoded image can therefore produce an error here even though its Base64 representation is valid. File encoding and text decoding serve different purposes.

The decoder adds missing trailing padding before decoding. It also accepts URL-safe dash and underscore characters and removes whitespace. Those conveniences do not repair arbitrary corruption: the remaining characters still need to form valid Base64, and the decoded bytes must represent valid UTF-8 text.

Related tools