Base64 Encoder & Decoder
Encode and decode Base64 text with full Unicode support, URL-safe output and file-to-Base64 conversion.
How to use the Base64 Encoder & Decoder
- Pick Encode or Decode, then type or paste into the input box. The result updates as you type.
- To encode for use in a URL or JWT-style token, tick “URL-safe alphabet”.
- Use the Copy and Download buttons to take the result, or “Use result as input” to round-trip it.
- For files, use the Files section: choose a file to get its Base64 (optionally as a data URI), or paste Base64 to download the decoded file.
Good to know
- Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide secrets.
- Text is converted with the browser's TextEncoder and TextDecoder (UTF-8). Decoding fails with a clear message if the bytes are not valid UTF-8; use “Base64 to file” for binary data.
- Decoding is strict: it rejects invalid characters, misplaced padding and impossible lengths, and rejects strings that mix the standard (+ /) and URL-safe (- _) alphabets. Whitespace and line breaks are ignored.
- Encoded output is about 33% larger than the input. Text input is capped at 2,000,000 characters and files at 10 MB.
Examples
- Plain text
- Hello, World! → SGVsbG8sIFdvcmxkIQ==
- Unicode and emoji
- Café ☕ → Q2Fmw6kg4piV (the text is encoded as UTF-8 first, so decoding returns the exact characters).
- URL-safe and unpadded
- Bytes that encode to “a+b/” in standard Base64 become “a-b_” in URL-safe form. Decoding accepts either, with or without trailing “=”.
Frequently asked questions
Why does the standard btoa() fail on emoji?
btoa only accepts characters up to U+00FF. This tool first converts your text to UTF-8 bytes, which can represent every character, and then encodes those bytes.
What is the difference between standard and URL-safe Base64?
URL-safe Base64 replaces + with - and / with _ so the result can sit inside a URL or file name without percent-encoding, and usually drops the = padding.
Are my files uploaded?
No. Files are read into memory in your browser and converted there. Nothing is sent to a server.
Related free tools
- Developer Tools
URL Encoder & Decoder
Percent-encode and decode URL components or whole URLs, with a clear explanation of when to use which.
Use tool - Developer Tools
JSON Formatter & Validator
Pretty-print, minify and validate JSON with line-and-column error messages. Runs entirely in your browser.
Use tool - Developer Tools
UUID Generator
Generate cryptographically random version 4 UUIDs in bulk, then copy or download them.
Use tool
Need Something Built For Your Business?
aimEncoders designs and builds custom software, websites and internal tools, backed by automated QA.
- Reply within 1 business day
- Fixed quote, no surprise invoices
- You own 100% of the code
Free discovery call • Straight to a developer • Strict NDA available