Developer ToolsEncoders & DecodersFree Tool

Base64 Encoder

Encode any text into Base64 using the browser-native btoa() function, with full Unicode/UTF-8 support.

How to Use Base64 Encoder
  1. 1Paste your text
  2. 2Make sure the Encode tab is selected
  3. 3Click Process
  4. 4Copy the Base64 output
About Base64 Encoder

What Base64 encoding is

Base64 turns arbitrary data into a string made only of letters, digits, +, / and = padding. That makes it safe to carry through systems that only handle plain text, such as email bodies, JSON fields, URLs or HTML attributes. This tool encodes the text you type as UTF-8 first and then as Base64, so accented letters, non-Latin scripts and emoji encode correctly instead of failing.

Example

The text Hello encodes to SGVsbG8=. The text café encodes to Y2Fmw6k=, because the é is two bytes in UTF-8.

Common uses

  • HTTP Basic authentication. The header value is the Base64 form of username:password.
  • Data URIs. Small images or fonts embedded in HTML or CSS use Base64 after data:image/png;base64,.
  • Email attachments. MIME encodes binary files as Base64 text.
  • Configuration and secrets in Kubernetes. Secret values are stored Base64-encoded.
  • Embedding binary data in JSON, which has no native binary type.

Important facts

  • Base64 is not encryption. Anyone can decode it instantly. Never use it to hide passwords or private data.
  • It makes data larger. Every 3 bytes become 4 characters, an increase of about 33%.
  • Padding. The trailing = signs fill the last group of bytes. Some systems strip them; many decoders accept either form.
  • Standard versus URL-safe. This tool uses the standard alphabet with + and /. URL-safe Base64 replaces them with - and _, which is what JSON Web Tokens use. Swap those characters if you need the URL-safe variant.
  • Text input only. This version encodes typed or pasted text. For files and images, the image tools on this site handle conversion directly.

Decoding

To reverse the process, paste the encoded text into the Base64 decoder. If you work with tokens, the JWT decoder reads the Base64URL sections of a token for you. For safe query strings, see the URL encoder.

Frequently Asked Questions

Your text is first UTF-8 encoded, then passed through the browser's native btoa() function — this two-step process ensures non-ASCII characters (emoji, accented letters, non-Latin scripts) encode correctly, which plain btoa() alone can't handle.

Yes — use the Encode/Decode tabs above the input to switch. Decoding runs the exact reverse process (atob() then UTF-8 decode).

No hard limit is enforced by this tool, but very large inputs may be slow since btoa() processes the whole string synchronously in your browser.

No — encoding happens entirely in your browser using native JavaScript functions; nothing is uploaded.

Related Tools

More from Developer Tools