Base64 Encoder Decoder
Encode text to Base64 or decode Base64 strings back to UTF-8 plain text instantly. Free, private, runs in your browser.
Runs in your browser · Free, no sign-up · Nothing is stored
About this tool
Modern network protocols, configuration files, and web APIs frequently use Base64 to represent binary content and complex strings within text-only formats. You often encounter Base64 strings when inspecting basic authentication headers, API keys, webhook payloads, or embedded data strings. Converting these representations manually is impossible, and opening a terminal command line can disrupt your workflow. This utility provides a dedicated text-to-Base64 encoder and Base64-to-text decoder directly in your browser. You can switch between Encode Mode and Decode Mode, process your text with a single click, and copy the converted output or save it using the download option. Because all processing runs entirely in your browser, your text input is not sent to a server.
How to use it
What is Base64 Encoding?
Base64 is a way to represent binary or special-character text using only 64 safe ASCII characters (A–Z, a–z, 0–9, +, /, =). It is commonly used to embed images in HTML, encode credentials in HTTP headers, and transmit binary data through text-only channels. This tool converts plain UTF-8 text to Base64 and decodes Base64 strings back to readable text.
Encoding is straightforward: type or paste text, click Encode, and get the Base64 string. Decoding reverses it: paste a Base64 string, click Decode, and read the original UTF-8 text. Invalid Base64 input produces an error instead of garbled output.
How to use it
- Type or paste your text into the input box.
- Click Encode to convert to Base64, or paste a Base64 string and click Decode.
- Copy the result with the Copy button.
Why use this over alternatives
Command-line base64 tools exist but require a terminal; many web alternatives add ads or upload your data. This tool runs locally in your browser using client-side JavaScript.
Real-World Base64 Use Cases & Common Edge Cases
1. Standard Base64 vs. URL-Safe Base64 (RFC 4648)
Standard Base64 outputs characters + and /, which are reserved in URLs and HTTP query parameters. URL-safe Base64 substitutes + with - and / with _, stripping trailing = padding:
Plain text : "auth/token?user=1"
Standard : "YXV0aC90b2tlbj91c2VyPTE="
URL-Safe : "YXV0aC90b2tlbj91c2VyPTE"
2. Multi-byte Unicode Strings (UTF-8 vs Latin-1)
Browsers' legacy btoa() and atob() functions only support 8-bit Latin-1 characters (0x00–0xFF). Attempting to encode UTF-8 emojis or non-English characters directly throws a DOMException: InvalidCharacterError. This tool uses a modern TextEncoder and TextDecoder pipeline to transparently support full UTF-8 Unicode.
💡 Related Engineering Deep Dive: Read our guide on Base64 Encoding Bugs: URL-Safe, Padding, and Byte Alignment Pitfalls.
Questions
- What character encoding is used?
- UTF-8. Text is encoded from UTF-8 to Base64, and decoded Base64 is interpreted as UTF-8, so international characters round-trip correctly.
- What happens with invalid Base64 input?
- The tool shows an error message instead of producing garbled output, so you know the input was not valid Base64.
- Can I encode binary files?
- This tool handles text input. For binary files like images, use the dedicated Image to Base64 tool on this site.
- Is my text uploaded anywhere?
- No. It runs locally in your browser using client-side JavaScript.
Related tools
All text & writing tools- Readability Score CheckerCheck how easy your text is to read with the Flesch Reading Ease score
- Markdown PreviewWrite GitHub Flavored Markdown on the left, see live HTML preview on the right
- URL Slug GeneratorConvert any text into SEO-friendly URL slugs instantly
- Word CounterCount words, characters, sentences, and paragraphs in any text