Developer

Base64 Encoder / Decoder

Encode UTF-8 text or raw file bytes to Base64, or decode Base64 back to text — with optional URL-safe alphabet and PEM-style line wrapping. Uses your browser’s btoa / atob with proper Unicode handling; nothing is uploaded.

Ad placement — top banner

No file loaded

Drop a file here Encode: raw bytes → Base64 · Decode: text file assumed to contain Base64
Mode
Ad placement — mid rectangle

What is Base64?

Base64 encodes binary data into a printable ASCII alphabet (A–Z, a–z, 0–9, +, /) with padding =. It is widely used for embedding small binaries in JSON, XML, email (MIME), and data URLs. It is not encryption — anyone can decode it — it is only an encoding for transport. RFC 4648 also defines a URL-safe variant that avoids + and / for use in query strings.

What this tool does

DroidXP’s Base64 Encoder uses TextEncoder when available to turn your text into UTF-8 bytes, then btoa on those bytes — so emoji and non‑Latin scripts round-trip correctly. Decoding uses atob plus TextDecoder to produce UTF-8 text again. File encode reads the file as raw bytes (not UTF-8 text), which matches how you attach binary payloads. File decode reads the file as text and treats it as Base64 (useful for PEM files or pasted blobs).

  • Optional URL-safe output and decoding of - / _ forms.
  • Optional line wrapping for long encoded strings (similar to PEM blocks).
  • Live stats and copy buttons for quick workflows.

How to use this tool

  1. Step 1: Choose Encode or Decode.
  2. Step 2: Paste text, or drop a file (encode = binary, decode = Base64 text).
  3. Step 3: Toggle URL-safe or wrapping if your API or format requires it.
  4. Step 4: Copy the output into your config, JWT debugger, or ticket.

Security note

Base64 is not a secret. Do not embed credentials or tokens in client-side only “encoding” — use proper encryption and transport security.

Frequently Asked Questions

Does DroidXP upload my data?

No. Encoding and decoding run in your browser. For sensitive material, still follow your organization’s policies on using web tools.

Why did decoding fail with “InvalidCharacterError”?

atob requires valid Base64 characters and correct padding. Remove spaces or line breaks if needed, or enable URL-safe mode if the string uses - and _.

Is this the same as Node’s Buffer?

Conceptually yes for bytes, but always verify in your runtime: Node uses Buffer; browsers use btoa/atob with Latin-1 unless you add UTF-8 helpers like this page does.

What is URL-safe Base64?

It replaces + and / with - and _ and often omits padding — common in JWT and query parameters. Toggle the option when your consumer expects that alphabet.

Can I encode huge files?

Very large files can exhaust tab memory. This tool caps very long text input; for big binaries, use a CLI or streaming encoder on your machine.

Why does my file encode differently from my UTF-8 text?

Encode file uses the file’s raw bytes. Encode on typed text uses UTF-8 bytes of that text. If the file is already UTF-8 text, the bytes match what you would get from saving the same string — but binary files will differ.

Does wrapping change the meaning of Base64?

Newlines are whitespace; decoders should ignore them. This tool strips whitespace when decoding so PEM-style wrapped lines still work.