DevFormatLab

Base64 Encode / Decode

Text · File · URL-safe

Encode and decode Base64 / Base64URL for text and files. Everything runs in your browser.

48 bytes → 64 chars
InputValid
Output

All encoding and decoding runs in your browser. Files are never uploaded.

What is Base64?

Base64 is a text-safe binary encoding: it represents arbitrary bytes using a 64-character alphabet (A-Z, a-z, 0-9, +, /) so the result can travel through systems that only handle text — JSON payloads, URLs, email bodies, data: URIs and HTTP headers. Encoding inflates size by ~33%, but it guarantees that no byte will be misinterpreted along the way. DevFormatLab's Base64 tool encodes and decodes both standard Base64 and the URL-safe variant (Base64URL, RFC 4648 §5) where + becomes - and / becomes _, with optional padding stripped. Everything runs locally in your browser via the native btoa / atob primitives plus TextEncoder for full Unicode support.

Features

  • Encode arbitrary UTF-8 text or any file to Base64
  • Decode Base64 back to text — auto-detects binary output and offers a file download
  • Standard Base64 and URL-safe Base64URL (RFC 4648)
  • Real-time, swap directions with one click
  • Auto-trim whitespace and line breaks before decoding
  • Reports input and output byte sizes
  • 100% browser-based — no upload, no tracking

How to use

  1. Pick a direction at the top: Encode (text → Base64) or Decode (Base64 → text/bytes).
  2. Paste your input on the left, or click "Open file" in encode mode to load a binary file.
  3. Toggle URL-safe if your target context is a URL or filename (uses - and _ instead of + and /).
  4. Read or copy the result on the right; download as a file when decoding produces binary data.

Frequently Asked Questions

Is my data uploaded anywhere?

▾

No. Encoding and decoding both run entirely inside your browser using the built-in btoa, atob and TextEncoder APIs. Files you load with "Open file" are read with the File API and never leave your device.

What's the difference between Base64 and Base64URL?

▾

Standard Base64 uses + and / and pads the output with =. Base64URL (RFC 4648 §5) replaces + with -, / with _, and usually drops the = padding so the result is safe to put inside URLs, JSON Web Tokens (JWT), filenames and HTTP headers.

Why does my decoded text look like garbled characters?

▾

The Base64 you decoded probably contained binary data (an image, an archive, a signature) rather than UTF-8 text. The tool detects this and lets you download the bytes as a .bin file instead — pick the right extension yourself.

Does it support full Unicode (emoji, CJK, etc.)?

▾

Yes. We use TextEncoder('utf-8') to convert input into bytes before encoding, and TextDecoder('utf-8') after decoding. So emoji, Japanese, Chinese and any other Unicode round-trips losslessly.

Is there a size limit?

▾

There's no enforced limit, but very large files (>50 MB) may be slow because the encoded result is held entirely in memory. For typical configs, tokens and small images the tool is instant.

What does data:image/png;base64,... mean?

▾

That's a Data URI — a way to inline a binary asset directly inside HTML or CSS. Strip the data:...;base64, prefix and paste the rest here in Decode mode to recover the original file.

Related tools

Canonical: https://devformatlab.com/en/base64