Home/Developer Tools/Base64 Encode/Decode

Base64 Encode/Decode

Encode or decode Base64 strings

Result
Output will appear here...

About Base64 Encode/Decode

Base64 Encoder/Decoder is a free online tool that converts plain text or binary data into Base64 encoded strings, and decodes Base64 strings back to their original content. Paste text or a Base64 string, click Encode or Decode, and get the result instantly. No sign-up, no server required — all processing happens in your browser.

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters: the uppercase letters A–Z, lowercase letters a–z, digits 0–9, and the symbols + and /. The name comes from each Base64 character encoding exactly 6 bits of data (2^6 = 64 possible values). Three bytes of binary input (24 bits) become four Base64 characters. This means Base64 encoded output is always exactly one-third larger than the original binary data — a 100-byte input becomes approximately 133 bytes of Base64.

The primary reason Base64 exists is that many data transmission protocols and storage systems were originally designed for text, not binary data. Email (SMTP) was designed for ASCII text — sending a binary file attachment directly over SMTP corrupts it. HTTP headers, JSON values, and XML content are text-based and cannot contain raw binary bytes. Base64 provides a universal translation layer that lets binary data travel safely through any text-based channel. Every email attachment you have ever received was Base64-encoded for transit inside the MIME format.

In web development, Base64 is used in several specific contexts. Data URIs embed binary assets directly in HTML and CSS using Base64 (e.g., src="data:image/png;base64,..."). HTTP Basic Authentication encodes the username:password pair as Base64 — not for security but as a standardised encoding scheme over HTTPS. HTTP Bearer tokens in the Authorization header are often Base64-encoded. JWT tokens use Base64URL encoding for their header and payload segments.

Base64URL is a URL-safe variant that replaces + with - and / with _, making the encoded string safe for use in URL query parameters, path segments, cookie values, and HTTP headers where + and / have special meaning. Our tool supports both standard Base64 and Base64URL variants. Knowing which variant you need is important — a standard Base64 string containing + or / will be corrupted if inserted directly into a URL without the URL-safe substitution.

Developers use Base64 Encoder/Decoder to inspect encoded values in JWTs, API authentication headers, and data URIs. QA testers decode Base64 values in API responses to verify encoded content. Security professionals decode Base64-encoded payloads in suspicious scripts, emails, and log entries. System administrators decode Base64-encoded configuration values in environment files and secrets management systems. Data analysts decode Base64-encoded fields in database exports.

Base64 Encoder/Decoder works entirely in your browser. Encoding uses JavaScript's btoa() function for text content. Decoding uses atob(), which reverses the encoding. For handling Unicode text beyond basic ASCII, the tool applies UTF-8 encoding before Base64 encoding and UTF-8 decoding after Base64 decoding to ensure non-ASCII characters are handled correctly. No data is ever sent to any server.

How to Use Base64 Encode/Decode

  1. 1Paste your plain text or Base64 string into the input field
  2. 2Click "Encode" to convert text to Base64, or "Decode" to convert Base64 back to plain text
  3. 3Toggle "URL-safe" mode if you need the output for use in URLs or HTTP headers
  4. 4Copy the result with a single click

Frequently Asked Questions

Base64 is used to encode binary data for transmission over text-based protocols. Common uses include email attachments (MIME), data URIs in HTML/CSS, HTTP Basic Authentication headers, JWT token encoding, and embedding binary data in JSON or XML.

No. Base64 is an encoding scheme, not encryption. It is fully reversible without any key — anyone can decode a Base64 string. Never use Base64 as a security measure. For security, use proper encryption (AES, RSA) or hashing (SHA-256, bcrypt).

Standard Base64 uses + and / as the 62nd and 63rd characters. Base64URL replaces + with - and / with _ to make the output safe for use in URLs, filenames, and HTTP headers where + and / are reserved characters. JWT tokens use Base64URL encoding.

Base64 encoding converts every 3 bytes of input into 4 ASCII characters, adding approximately 33% overhead. This size increase is inherent to the encoding — it is the cost of representing binary data as printable text.

No. All encoding and decoding runs in your browser using JavaScript. Your data never leaves your device.

You might also like