Xgenious
developer

Free Base64 Encoder & Decoder — Online, No Login

Base64 encoding converts binary data or text into a printable ASCII string using 64 characters (A–Z, a–z, 0–9, +, /). It is used to transmit binary data over channels that only support text — email attachments, data URIs, JWT tokens, and API payloads. This tool encodes and decodes instantly in the browser.

Free — No SignupRuns in BrowserData Never UploadedPopular tool

developer

Encode and decode Base64 strings instantly in your browser.

  • Encode plain text to Base64 with full UTF-8 support (emoji and non-Latin scripts)
  • Decode any Base64 string back to readable text instantly
  • URL-safe Base64 mode — RFC 4648 compliant, replaces + / with - _
  • File to Base64 — encode images and documents locally, nothing uploaded
  • Swap input and output in one click for round-trip testing
  • Nothing stored — refresh and all data is gone
Features

Everything you need in one Base64 Encoder / Decoder

Base64 encoder

Convert plain text into a Base64 string for embedding in JSON fields, HTTP headers, data URIs, and email MIME parts. Full UTF-8 support means emoji and non-Latin scripts encode correctly.

Base64 decoder

Decode any Base64 string back to readable text. Useful for inspecting JWT payloads, API responses, and config values that store data in Base64.

URL-safe Base64 converter

Toggle the RFC 4648 URL-safe alphabet, which replaces + and / with - and _ so the output is safe inside URLs, query strings, and filenames without percent-encoding.

File to Base64

Encode an image or document into a Base64 data URI you can paste directly into HTML or CSS. The file is read locally in your browser and never uploaded to any server.

How It Works

How to use Base64 Encoder / Decoder

01

Choose Encode or Decode

Select whether you want to convert text to Base64 or decode a Base64 string back to plain text.

02

Paste your input

Enter the text or Base64 string. Optionally enable URL-safe mode (replaces + with - and / with _).

03

Copy the result

The output updates instantly. Click Copy to clipboard.

Format Comparison

Where Base64 is used — common use cases

Use caseWhat Base64 does
Data URIsEmbeds images or fonts directly in HTML/CSS as data:image/png;base64,...
JWT tokensEncodes the header and payload as URL-safe Base64 segments
Email attachments (MIME)Carries binary files through text-only SMTP
HTTP Basic AuthenticationEncodes the username:password credential string
API payloads (JSON)Stores binary blobs inside JSON fields that accept only text
Binary in databasesKeeps binary data in text-only columns without corruption
Troubleshooting

How to fix common syntax errors

Most “invalid JSON” failures come from a small set of mistakes. Paste the failing JSON above, click Validate, and the tool points you at the exact line and column.

Garbled decoded outputbinary data decoded as UTF-8

The Base64 was encoded from non-UTF-8 binary (e.g. an image). Decoding it as text will always produce garbage — it is binary data, not a string.

Invalid Base64 — missing paddingbase64 string length not multiple of 4

Base64 strings must be padded with `=` to reach a length that is a multiple of 4. If the string is truncated or stripped of padding, add `=` characters to the end until the length is correct.

URL-safe characters not decoded- and _ in standard mode

The input uses the URL-safe alphabet (- and _ instead of + and /). Enable URL-safe mode before decoding, or manually replace - → + and _ → / before pasting.

Using Base64 as encryptionbase64("password") stored as secret

Base64 provides zero security — it is instantly reversible without a key. Use AES-256 for encryption and bcrypt or Argon2 for password hashing.

Encoding already-encoded datadouble Base64 encoding

Encoding a Base64 string again produces a double-encoded result. Decode first, verify the output is the original plain text, then re-encode only if needed.

Stray whitespace or newlinesbase64 copied from email or terminal

MIME email and many CLI tools wrap Base64 at 76 characters per line. Strip all whitespace and newlines before decoding — the string must be a single unbroken sequence of valid Base64 characters.

FAQ

Frequently asked questions

Base64 encoding converts binary or text data into a string of 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It increases data size by approximately 33% but ensures the data can safely pass through text-only channels like email systems, JSON fields, and HTTP headers that cannot reliably transmit arbitrary binary data.

Have a project in mind?

We turn ideas into production-ready software — SaaS, web apps, mobile, and AI agents. Fixed price. Committed timeline. No surprises.

Let's talk