🔐 Base64 Encoder & Decoder

Encode text to Base64 or decode it back. UTF-8 round-trip in the browser.

Free Instant results No sign-up needed
input.txt
0 lines
0 chars TEXT
output.b64
0 lines
0 chars BASE64

Encode turns the left-hand text into a Base64 string using UTF-8 first (encodeURIComponent + btoa). Decode strips whitespace, then runs atob and UTF-8 reversal. There is no file picker and no URL-safe alphabet toggle.

Encoding is not a lock

Base64 is a 64-character alphabet so binary-ish data can travel through JSON, XML, or email. Anyone can reverse it. It is not encryption, not a hash, and not a password store. A JWT’s middle segment is Base64url, which this tool does not emit (no -/_ alphabet, no padding strip).

What the buttons do

  1. Paste or type on the left, or use Paste / Sample.
  2. Encode writes Base64 on the right. Decode expects Base64 on the left (spaces and line breaks are ignored).
  3. Copy copies the right pane. Save downloads base64-output.txt. Clear empties both sides.

UTF-8 and padding

Plain btoa only accepts bytes in the 0–255 range. This page first encodes the string as UTF-8 so characters such as ₹ or emoji survive a round-trip. Decode fails with “Invalid Base64” if the string has the wrong length, illegal characters, or is not padded with = where the alphabet requires it.

Round-trip

Text
Nexora — ₹100
After Encode
TmV4b3JhIOKAlCDigrkxMDA=

What this page will not do

  • Encode a PNG or PDF as a data URL (text only).
  • Produce Base64url for JWTs or filenames.
  • Hide the original text. The output is longer than the input by about 33%.

Where conversion happens

Both directions run in the tab. Theme is remembered in sessionStorage. The strings are not posted to our servers.

Base64 questions

Is this encryption?

No. Anyone can decode the string. Use it for transport, not secrecy.

Why did decode fail?

Wrong length, illegal characters, or missing padding. Whitespace is stripped first.

Can I encode a PNG?

Not on this page. There is no file input.

Is this JWT Base64url?

No. The alphabet is standard Base64 with + / and = padding, not - _.

Does the text leave the tab?

No. Conversion is local.

Nearby encoding tasks

Percent-encoding uses a different alphabet; QR codes take the decoded text: URL Encoder / Decoder, QR Code Generator, JSON Formatter. Browse the full Developer set or the all tools hub.