Updated Developer Tools

Base64 Encoder/Decoder

Encode text or files to Base64, decode Base64 back to text or downloadable files, and work with URL-safe Base64 and Data URIs.

Text Files URL-safe Data URI

Base64 Encoding, Decoding, URL-Safe Conversion, and Data URI Tools

Paste input or choose a file, pick options, and get clean output with size details and download support.

What Base64 Is (and What It Is Not)

Base64 is a way to represent binary data as plain text. It is commonly used when you need to send or store bytes in systems designed for text, such as JSON payloads, HTML attributes, CSS, email bodies, or log streams. Base64 is not a file type and it is not a compression method. Most importantly, it is not encryption. If something must be secret, it needs real encryption or a secure transport mechanism, not Base64.

Why Base64 Increases Size

Base64 works by mapping groups of 3 bytes into 4 characters. Because 4 is larger than 3, the encoded output is larger than the original data. The typical overhead is about one third, plus optional padding characters (=) and optional line breaks (used in some email and legacy systems). This tool shows size changes so you can quickly see the impact before embedding Base64 in an API or a config.

Text Base64 vs File Base64

When you encode text, you first turn characters into bytes using an encoding such as UTF-8. The Base64 output depends on those bytes. If you decode Base64 that originally came from a file (like PNG or PDF) and try to display it as text, it may look like “garbled” characters because the bytes are not meant to be interpreted as text. In that case, decode the bytes and download the file instead.

URL-Safe Base64 (Base64url)

Standard Base64 uses two characters (+ and /) that can cause problems in URLs and cookies unless escaped. URL-safe Base64 replaces them with - and _. Many systems also omit padding (=) for convenience. This tool converts in both directions and can add or remove padding depending on what your target system expects.

Data URIs and When to Use Them

A Data URI embeds data directly into a URL-like string, for example:

data:image/png;base64,iVBORw0KGgo...

This is useful for small assets such as tiny icons, small CSS images, or quick prototypes where you want a single file without external requests. For large images or fonts, Data URIs can bloat HTML/CSS and hurt caching. The Data URI tab helps you create and parse these safely, showing the MIME type and payload size.

Padding, Line Breaks, and Compatibility

Some libraries are strict and require Base64 length to be a multiple of 4 (with padding). Others accept missing padding and ignore whitespace. If you encounter “InvalidCharacterError” or similar decode errors, the issue is often missing padding or URL-safe characters being decoded by a standard decoder. This tool can normalize URL-safe alphabets and add padding so you can get a clean decode across environments.

Practical Use Cases

  • API debugging: decode Base64 fields from API responses to see what they contain.
  • File transfer: embed a small binary payload in JSON for a controlled environment.
  • JWT segments: JWT uses Base64url (URL-safe) without padding for header and payload segments.
  • Data URIs: inline small images or SVG/PNG snippets for quick prototypes.
  • Email tooling: some MIME systems wrap Base64 at 76 characters per line.

Privacy Notes

Base64 is often used to wrap sensitive content like tokens, keys, or personal data. This tool runs locally in your browser and does not upload your content. Still, treat Base64 as readable data: if you paste it into public logs or share screenshots, anyone can decode it. Redact secrets before sharing.

FAQ

Base64 Encoder/Decoder – Frequently Asked Questions

Quick answers about Base64 encoding, padding, URL-safe variants, files, and Data URIs.

Base64 encodes binary data (like images or files) into text so it can be safely sent in JSON, HTML, CSS, or email systems that expect text.

No. Base64 is not encryption and provides no security. Anyone can decode Base64 back to its original data.

It is usually a character encoding issue. Ensure the original text was UTF-8 and that you decode as UTF-8. For files, decode to bytes and download the file instead of viewing as text.

URL-safe Base64 replaces + and / with - and _ and often removes padding (=) so it can be used in URLs and cookies without escaping.

Padding makes the Base64 length a multiple of 4. Many decoders accept missing padding, but strict systems may require it. This tool can add or remove padding.

A Data URI embeds data directly in a URL-like string, often used for small images or fonts, like: data:image/png;base64,...

Yes. Base64 typically increases size by about 33% because 3 bytes become 4 Base64 characters, plus optional line breaks or Data URI headers.

No. Encoding and decoding are done locally in your browser. Files stay on your device.

Yes. Use the File tab to encode a file to Base64 or decode Base64 back into a downloadable file.

This tool runs entirely in your browser. Base64 is not encryption. Avoid sharing Base64 strings that contain secrets, tokens, or personal data.