Skip to content
Calixo

Base64 Encoder / Decoder

Encode text to Base64 or decode Base64 back to text, entirely in your browser — a foundational tool for safely embedding binary data in text-based formats.

Inputs

Paste this into any page — the widget stays live and updates automatically as this calculator improves. Using WordPress or Notion? See the embed guide.

Saved Scenarios

— select 2+ to compare
Inputs updated · Results recalculated · Just now

Result

SGVsbG8sIENhbGl4byE=

Spark says

Vivid, blurred close-up of colorful code on a screen, representing web development and programming.
Photo by Markus Spiske on Pexels
Vibrant green numbers on a computer screen, showcasing binary code and data streams.
Photo by Tibe De Kort on Pexels

Formula

Base64=groups of 3 bytes4 printable charactersBase64 = groups\ of\ 3\ bytes \rightarrow 4\ printable\ characters
Base64
— A 64-character alphabet (A-Z, a-z, 0-9, +, /) for representing binary data as text

What is the Base64 Encoder / Decoder?

Base64 encodes arbitrary binary or text data using only 64 printable ASCII characters — commonly used to safely embed data in JSON, URLs, or email where raw binary isn't allowed. It's an encoding, not encryption: anyone can decode it back instantly.

Use this when embedding binary or special-character data in a text-based format like JSON, a URL, or an email attachment, decoding a Base64 string you've encountered in an API response or configuration file, or understanding what a piece of Base64-encoded data actually contains.

How to use it

  1. 1 Choose encode or decode mode.
  2. 2 Enter your text or Base64 string.

Understanding Base64 Encoder / Decoder

Base64's genuine purpose is solving a specific, practical compatibility problem: many text-based protocols, formats, and systems — email, JSON, URLs, and many configuration file formats among them — were designed to reliably handle only a limited, printable subset of possible byte values, and can behave unpredictably or fail entirely when raw binary data (which can contain any of 256 possible byte values, including many non-printable ones) is embedded directly within them.

Base64 solves this by re-representing arbitrary binary data using only 64 specific, universally safe printable characters — the uppercase and lowercase English letters, the ten digits, and two additional symbols (conventionally + and /, with some variants using different symbols for URL-safety). This 64-character alphabet is specifically chosen because every one of these characters is safely and predictably handled by virtually all text-based systems and protocols, sidestepping the encoding and interpretation inconsistencies that raw binary data could otherwise trigger in a text-oriented context. The specific mathematical mechanism — grouping the original binary data into sets of 3 bytes (24 bits total) and re-expressing each such group as 4 Base64 characters (since each Base64 character represents 6 bits, and 4 times 6 also equals 24) — is precisely why Base64-encoded data is reliably larger than the original raw data, by a factor of exactly 4/3, or roughly 33% larger: representing the same total amount of information using a more restricted, printable-only character set inherently requires more characters than would be needed with unrestricted access to the full binary byte range.

The genuinely important, sometimes misunderstood distinction between Base64 encoding and actual encryption is worth stating clearly and directly: Base64 provides zero security or confidentiality whatsoever. It's a pure, fully reversible data representation transformation — anyone who encounters a piece of Base64-encoded data can decode it back to its original form instantly, using nothing more than a standard, freely available decoding algorithm (exactly what this calculator's decode function does), with no secret key, password, or special knowledge required at all. This is a genuinely important distinction to understand clearly, because Base64-encoded data can visually look 'scrambled' or obscured to someone unfamiliar with the format, creating a false, superficial impression of security that doesn't actually exist — Base64 is functionally similar to writing a message in a different, publicly known alphabet rather than genuinely encrypting it, and treating Base64-encoded sensitive data as if it were actually protected is a real, sometimes consequential security mistake.

Despite providing no security, Base64 remains a genuinely essential, widely used encoding across modern computing infrastructure for its actual intended purpose — safe binary-to-text compatibility, not confidentiality. Email attachments have historically used Base64 encoding specifically because the underlying email transmission protocols were originally designed for text content and couldn't reliably transmit raw binary data directly. Many APIs use Base64 to embed binary data (like a small image, or a cryptographic key) within a JSON payload, since JSON's string type is fundamentally text-based and can't directly represent arbitrary binary content. Data URLs (allowing an image or other resource to be embedded directly within an HTML or CSS file, rather than requiring a separate file request) commonly use Base64 encoding for exactly this same underlying reason — enabling binary content to be safely represented within an otherwise text-based format, a genuinely different and much more limited purpose than the confidentiality that actual encryption is specifically designed to provide.

Worked examples

Advantages

  • Handles full UTF-8 text correctly, including emoji and non-Latin scripts, not just basic ASCII.
  • Works entirely client-side in your browser, with no data sent to any server.
  • Simple, instant bidirectional conversion for both encoding and decoding.
  • Directly clarifies the important distinction between Base64 encoding and actual encryption.

Limitations

  • Handles full UTF-8 text safely, including emoji and non-Latin scripts — but decoding invalid Base64 input will show an error rather than garbage output.

Common mistakes

  • ⚠️ Assuming Base64 encoding provides any security or confidentiality, when it's purely a data representation format that anyone can decode instantly without any special knowledge or key.
  • ⚠️ Confusing Base64 encoding with actual data compression, when Base64 encoding actually increases data size (by roughly a third) rather than reducing it.
  • ⚠️ Attempting to decode a string that isn't actually valid Base64, expecting a reasonable result rather than an error, when malformed input simply can't be correctly decoded.

Tips

  • 💡 Is Base64 a form of encryption? No — Base64 is just an encoding for representing bytes as text; it provides no security or confidentiality, since anyone can decode it instantly without a key.
  • 💡 Remember Base64 encoding increases data size by roughly a third compared to the original raw data — it's a format-compatibility tool, not a compression technique.
  • 💡 Never treat Base64-encoded data as secure or hidden — if genuine confidentiality is needed, use actual encryption, not Base64 encoding, which anyone can trivially reverse.
  • 💡 Use Base64 specifically for its intended purpose: safely representing binary or special-character data within text-only formats and protocols that can't directly handle raw binary content.

Real-life uses

  • Embedding binary or special-character data in a text-based format like JSON, a URL, or an email attachment
  • Decoding a Base64 string encountered in an API response or configuration file
  • Understanding what a piece of Base64-encoded data actually contains
  • Preparing binary data (like an image) for inclusion in a text-only context

Frequently asked questions

Is Base64 a form of encryption?

No — Base64 is just an encoding for representing bytes as text; it provides no security or confidentiality, since anyone can decode it instantly without a key.

Why does Base64-encoded data take up more space than the original?

Base64 groups binary data into sets of 3 bytes (24 bits) and re-expresses each group as 4 printable characters — representing the same information using a more restricted character set inherently requires more characters, roughly 33% more than the original raw data.

Why does Base64 use exactly 64 characters?

64 characters (uppercase and lowercase letters, digits, and two symbols) can each represent exactly 6 bits of data, and this specific alphabet is chosen because every character in it is safely and predictably handled by virtually all text-based systems and protocols.

Why is treating Base64 as 'hidden' or secure a mistake?

Base64 is a fully reversible, publicly known encoding — anyone can decode it instantly with a standard algorithm and no secret key, so data that genuinely needs confidentiality requires actual encryption, not Base64 encoding.

Why do email attachments and some APIs use Base64?

Many text-based protocols and formats (like email transmission or JSON) weren't designed to reliably handle raw binary data directly — Base64 solves this specific compatibility problem by representing binary data using only safe, printable characters.