🔢 Web & Developer

Base64 Encoder / Decoder

Encode plain text to Base64 or decode Base64 strings instantly. Supports standard and URL-safe Base64. Runs entirely in your browser — nothing is ever sent to a server.

Advertisement

🔢 Base64 Encoder / Decoder

Enter plain text to encode, or paste a Base64 string to decode. Results appear below instantly.

⚠️ Base64 is encoding, not encryption. Anyone can decode it. Never use this tool to protect sensitive data.
Advertisement

What Is a Base64 Encoder?

This free Base64 encoder and decoder converts plain text to Base64 format and decodes Base64 strings back to readable text — instantly, entirely in your browser. This Base64 encoder also supports URL-safe Base64, which replaces + and / with − and _ for safe use in URLs and filenames without percent-encoding.

Base64 encoding is used throughout web development, APIs, and data transfer. In fact, you encounter Base64 every time you see an embedded image in HTML, inspect a JWT token, send an email attachment, or set up HTTP Basic Authentication. This Base64 encoder makes all of those conversions instantly accessible.

How Does This Base64 Encoder Work?

This Base64 encoder converts every 3 bytes of input data into 4 Base64 characters from the standard 64-character alphabet (A–Z, a–z, 0–9, +, /). If the input is not divisible by 3 bytes, padding characters (=) are added to complete the last group. The URL-safe mode of this Base64 encoder replaces + with − and / with _ and removes the = padding entirely.

Every 3 input bytes → 4 Base64 characters
Output size ≈ input size × 4/3 (approximately 33% larger)
URL-safe: replace + → − and / → _ and strip = padding

How to Use This Base64 Encoder

  1. To encode: Type or paste plain text into the input field, then click “Encode to Base64”. The Base64-encoded result appears in the output.
  2. To decode: Paste a Base64 string into the input field, then click “Decode from Base64”. The original plain text appears in the output.
  3. URL-safe mode: Check the URL-safe option before encoding if you need the result for use in a URL, cookie, or filename without percent-encoding.
  4. Copy: Click the Copy button to copy the output to your clipboard.
💡 If decoding fails with an error, check for whitespace or line breaks in the Base64 input — these are the most common causes of decoding errors. Remove any spaces or newlines and try again in this Base64 encoder.

When to Use This Base64 Encoder

  • Embedding images in HTML or CSS: Convert image data to Base64 with this encoder for use as data URIs (data:image/png;base64,…) — eliminating a separate HTTP request.
  • JWT token inspection: JWT tokens use URL-safe Base64 for their header and payload sections. Decode them with this Base64 encoder to read the contents without a third-party tool.
  • HTTP Basic Authentication: Basic Auth sends username:password as a Base64 string in the Authorization header. Use this Base64 encoder to create or verify those credentials.
  • Email attachments: MIME encoding uses Base64 to convert binary file attachments into text for safe email transmission.
  • API payloads: Some APIs require binary data — images, PDFs, certificates — to be Base64-encoded before including in JSON payloads.

Is This Base64 Encoder Safe?

Yes — this Base64 encoder runs entirely in your browser using JavaScript’s built-in btoa() and atob() functions. No data is ever sent to any server. Even the developers of this site cannot see what you encode or decode. However, Base64 is not encryption. According to the MDN Web Docs Base64 reference, Base64 is a binary-to-text encoding scheme — it provides interoperability, not security. Anyone who has a Base64 string can decode it instantly.

Base64 Encoder — Frequently Asked Questions

What is URL-safe Base64 in this Base64 encoder?
Standard Base64 uses + and / which have reserved meanings in URLs — they would need to be percent-encoded as %2B and %2F, breaking many URL parsers. URL-safe Base64 from this encoder replaces + with − and / with _ so the result is safe for use in URLs, cookies, query strings, and filenames without any further encoding. JWT tokens use URL-safe Base64 without the trailing = padding.
Why is the Base64 output larger than my input?
Base64 encoding increases data size by approximately 33%. Every 3 bytes of input become 4 Base64 characters. This size increase is the expected trade-off of representing binary data as printable ASCII text — it is not a bug in this Base64 encoder. The increase is predictable and always approximately one third larger than the original.
Can this Base64 encoder handle non-English characters?
Yes — this Base64 encoder uses encodeURIComponent() internally to handle UTF-8 characters correctly before encoding. This means it correctly encodes text containing accented characters, Arabic, Chinese, Japanese, and other non-ASCII text. Standard Base64 btoa() alone would fail on non-ASCII input — this encoder handles it properly.
Is Base64 the same as encryption?
No — Base64 is encoding, not encryption. It converts data to a different representation but provides no confidentiality. Anyone with a Base64 string can decode it instantly using any Base64 encoder or decoder. Never use Base64 to protect passwords, API keys, or any sensitive information — use proper encryption instead.
Is this Base64 encoder free?
Yes — this Base64 encoder and decoder is completely free. No registration, no account, and all encoding and decoding happens locally in your browser. Your data never leaves your device.
Advertisement

Scroll to Top