Encoding

Base64 Encode/Decode

Convert text to Base64 or decode it back, with correct UTF-8 handling. Runs entirely in your browser; nothing you type is ever sent anywhere.

Plain Text
Base64
Encoded output will appear here.

Quick Learn

Base64 turns arbitrary bytes into a string made only of A–Z, a–z, 0–9, +, /, and a trailing = for padding — a character set safe to drop into places that were only ever designed for plain text, like JSON fields, email bodies, URLs, or a Basic Auth header. It isn't encryption and isn't compression; encoded text is actually about 33% larger than the original, since every 3 bytes of input become 4 Base64 characters. Anyone can decode it instantly, so never use Base64 as a way to hide secrets — use it purely as a text-safe transport format.

The most common mistake is handling non-ASCII text with the browser's built-in btoa()/atob() directly — they operate on UTF-16 code units, not bytes, and throw or corrupt data on anything outside Latin1 (accented letters, CJK text, emoji). This tool encodes through TextEncoder first, so café, 日本語, and 🚀 all round-trip correctly, matching how Base64 is actually used in modern JSON APIs and JavaScript code.

Best Practices

  • •Never treat Base64 as encryption — it's a reversible text encoding with no key, decodable by anyone in one line of code.
  • •For binary files (images, PDFs), use a data URI (data:image/png;base64,...) rather than a bare Base64 string, so the receiving context knows how to interpret the bytes.
  • •Base64url (using - and _ instead of + and /, and usually no = padding) is a different variant used in JWTs and URLs — a value copied from one context may need those characters swapped before it decodes elsewhere.
  • •Whitespace and line breaks inside a Base64 string are usually safe to strip before decoding — this tool does that automatically — but don't assume every decoder is that forgiving.

More Encoding Tools

See all Encoding tools

Frequently Asked Questions

No. Encoding and decoding both happen entirely in your browser using the native TextEncoder/TextDecoder and btoa/atob APIs — nothing you paste is sent to a server.

Want the engineering deep-dives behind tools like this one?