Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Base64 Encoder & Decoder

Text and files to Base64 and back — UTF-8 safe, URL-safe, data URIs.

Developer No upload Works offline Free, no sign-up

Next steps

About the Base64 Encoder & Decoder

Convert text to Base64 and back as you type. Text is encoded as UTF-8 by default, so accents, Hindi, emoji and every other script survive the round trip — something the browser's btoa() cannot do. You can switch to the URL-safe alphabet (used by JWTs and many APIs), drop the = padding, or wrap lines for email (MIME) and PEM files.

Decoding is forgiving where it should be and precise where it matters: line breaks, spaces, missing padding, quotes and data: prefixes are handled automatically, and genuinely broken input gets an exact line and column. If the decoded data is a file rather than text, the tool recognises it from its first bytes — PNG, JPEG, GIF, WebP, PDF, ZIP, Office documents, SVG and more — shows a preview for images and lets you download it. The File → Base64 tab turns any file up to 25 MB into Base64 or a ready-to-paste data URI.

How to use it

  1. Choose Encode or Decode, then type or paste into the box. The result updates instantly.
  2. Pick options if you need them: text encoding, URL-safe alphabet, padding and line breaks.
  3. When decoding gives a file (for example an image), check the detected type and press Download file.
  4. To encode a file, open the File → Base64 tab, choose or drop the file, and pick Base64 or data URI output.
  5. Use Copy or Download, or Use as input to reverse the conversion.

Examples

UTF-8 text
Input
café ✓
Result
Y2Fmw6kg4pyT
URL-safe Base64 without padding
Input
Bytes FB FF FE (hex)
Result
Standard: +//+ · URL-safe: -__-

The URL-safe alphabet (RFC 4648 §5) swaps + and / for - and _ so the value can sit in a URL or file name without escaping.

PowerShell -EncodedCommand
Input
Get-Date
Result
RwBlAHQALQBEAGEAdABlAA==

PowerShell expects UTF-16LE text, so choose UTF-16LE as the text encoding.

Decode a data URI
Input
data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==
Result
Hello, World!

Common uses

  • Embedding small images, icons or fonts in HTML, CSS or JSON as data URIs.
  • Reading Base64 fields in API responses, webhooks, Kubernetes secrets and configuration files.
  • Turning a Base64 attachment or API payload back into the original PDF, image or ZIP file.
  • Preparing Basic authentication headers, PowerShell encoded commands and email (MIME) bodies.
  • Inspecting PEM certificates and keys: the Base64 body decodes to the binary DER data.

How Base64 works

Base64 (RFC 4648) turns every 3 bytes into 4 characters from a 64-character alphabet: A–Z, a–z, 0–9, + and /. When the data is not a multiple of 3 bytes, the last group is padded with one or two = signs. That is why encoded data is about 33% larger than the original.

Base64 is an encoding, not encryption: anyone can decode it. Never treat a Base64 value as a secret.

Variants you may meet

  • Base64url (RFC 4648 §5) uses - and _ instead of + and /. JWTs use it without padding (RFC 7515).
  • MIME email bodies wrap lines at no more than 76 characters (RFC 2045).
  • PEM files (certificates, keys) wrap at 64 characters between -----BEGIN …----- and -----END …----- lines (RFC 7468).
  • Data URIs look like data:image/png;base64,iVBOR… (RFC 2397).

The decoder accepts all of these: it removes line breaks and spaces, accepts either alphabet, does not require padding, and strips data: prefixes and PEM armour for you.

Limitations

  • Files up to 25 MB can be encoded, and Base64 text up to about 40 MB decoded. Very large results are shown as a shortened preview; Copy and Download always use the full result.
  • File types are recognised from their first bytes. Unusual formats are offered as a generic .bin download.
  • Previews are shown for image formats your browser can display; other files are offered as downloads.

Privacy

Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.

Frequently asked questions

Why does my text come out garbled in other Base64 tools?

JavaScript's built-in btoa() only handles Latin-1 characters and throws on anything else, and some tools encode text as Latin-1 or UTF-16. This tool uses UTF-8 by default — the encoding used by the web, JSON and almost every API. If you need another encoding, choose it under Text encoding.

Is it safe to decode Base64 that contains passwords or tokens?

Yes. Everything happens in your browser and nothing is sent to a server. Remember that Base64 is not encryption: anyone who has the encoded text can read it.

What does "Invalid character" mean when decoding?

Base64 only contains letters, digits, +, / (or - and _) and =. The message shows the exact line and column of the first character that does not belong — often a stray quote, a % from URL encoding, or a dot from a JWT.

Do I need the "=" padding?

Many decoders, including this one, do not need it, but some strict ones do. JWTs and most URL-safe uses leave it out; email and most file formats keep it. If in doubt, keep padding on.

How do I turn a Base64 string back into an image or PDF?

Choose Decode and paste the string, with or without the data: prefix. The tool detects the file type, previews images and gives you a Download file button with the right extension.

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.