Loading Base64 Encoder/Decoder...

Base64 Encoder / Decoder

Encode text to Base64 or decode Base64 back to text — instantly, in your browser.

Plain Text

Base64 Output

Encode or Decode Base64 Instantly

This free online tool converts text to and from Base64 — the encoding used to safely represent binary or text data as ASCII, commonly seen in data URIs, Basic Auth headers, and email attachments. Type or paste your text, pick Encode or Decode, and get the result immediately.

How It Works

UTF-8 Safe Encoding

Plain JavaScript's btoa() throws on any character outside the Latin-1 range, which breaks on emoji, accented letters, and most non-English text. This tool encodes text as UTF-8 bytes first, so any Unicode text — including emoji — encodes and decodes correctly.

Privacy

All encoding and decoding happens entirely in your browser using JavaScript. Nothing you type is ever sent to a server.

Base64 Encoding — Options Explained

Base64 has a couple of variants that matter depending on where the encoded text ends up. Here's what each option on this page does.

Standard Base64

Uses the characters A-Z a-z 0-9 + / with = padding at the end. This is the default and matches what most libraries and command-line tools (like base64) produce.

URL-Safe Base64

Replaces + with - and / with _, and omits padding — because standard Base64's characters have special meaning in URLs and filenames. Common in JWTs and URL parameters.

UTF-8 Text Handling

Text is first converted to its UTF-8 byte representation before Base64 encoding, and decoded the same way in reverse — so accented characters, symbols, and emoji round-trip correctly.

Invalid Input Handling

If the Base64 input contains invalid characters or can't be decoded as valid UTF-8, the tool shows an inline error instead of producing garbled or silently wrong output.

Who Uses This Tool?

API Developers

Decode a Basic Auth header, a JWT segment, or a Base64-encoded field in an API response to see its real value during debugging.

Backend Developers

Encode config values, tokens, or small binary blobs into Base64 text for embedding in JSON, environment variables, or config files.

Web Developers

Build or inspect small inline data URIs (data:text/plain;base64,...) without reaching for a script or command-line tool.

Students & Learners

See exactly how Base64 encoding works, character by character, while learning about data encoding and transport formats.

Frequently Asked Questions

What is Base64 encoding?

Base64 is a way to represent binary or text data using only 64 printable ASCII characters (A-Z a-z 0-9 + /), commonly used when data needs to be safely embedded in text-based formats like JSON, XML, URLs, or email.

Is Base64 encryption?

No. Base64 is an encoding, not encryption — it provides no confidentiality. Anyone can decode Base64 text back to its original form instantly, which this tool demonstrates. Never use Base64 alone to protect sensitive data.

What's the difference between standard and URL-safe Base64?

Standard Base64 uses + and /, which have special meaning inside URLs. URL-safe Base64 replaces them with - and _ and drops the = padding, so the result can be used directly inside a URL or filename without further encoding.

Why did decoding fail with an error?

Decoding fails if the input contains characters outside the Base64 alphabet, or if the decoded bytes aren't valid UTF-8 text. This usually means the input is truncated, corrupted, or wasn't actually Base64 to begin with.

Is my data uploaded anywhere?

No. All encoding and decoding happens locally in your browser with JavaScript. Nothing is sent to a server.

Built by Deepak Kumar — a developer who wanted a JSON tool that respects your privacy. All processing happens in your browser. Your data never leaves your device.