Developer Tools
Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 back to text, with correct UTF-8 handling for every language and emoji. A separate file mode converts images, PDFs and other files.
Runs in your browser
Features
What you get
True UTF-8
Every language and emoji round-trips exactly, using TextEncoder and TextDecoder.
Strict validation
Invalid characters, misplaced padding and truncated input are explained, with the position of the problem.
URL-safe and MIME options
Output the URL-safe alphabet (- _ without padding) or wrap lines at 76 characters; decode either, with or without whitespace.
File mode
Encode any file up to 25 MB, or decode Base64 back into a downloadable file — type detected automatically.
Size at a glance
Input and output characters and bytes, so you can see Base64's 33% overhead.
Responsive with large data
Files are processed in chunks so the page stays usable.
How to use
How to use the Base64 Encoder & Decoder
Text is first converted to UTF-8 bytes with the browser's TextEncoder — so Hindi, Arabic, Chinese and emoji encode correctly, unlike calling btoa() on the raw string. Every 3 bytes become 4 Base64 characters, which is why encoded data is about 33% larger. Decoding validates the alphabet, padding and length, accepts the URL-safe variant (- and _), and only shows text if the bytes are valid UTF-8; otherwise it tells you the data is binary and lets you download it as a file.
- 01
Choose Text or File
Text mode for strings; File mode for images, PDFs and other files.
- 02
Encode or decode
Pick a direction and paste or upload your input. Text results update as you type.
- 03
Copy or download
Copy the result, download it as text, or download the decoded file.
Examples
Worked examples
Plain text
"Hello" encodes to SGVsbG8= — 5 bytes become 8 characters.
Unicode
"café" encodes to Y2Fmw6k=, because é is two bytes in UTF-8.
URL-safe
"??>>" is Pz8+Pg== in standard Base64 and Pz8-Pg in the URL-safe variant used in JWTs.
Technical specifications
- Alphabet
- RFC 4648 standard and URL-safe
- Text encoding
- UTF-8 (TextEncoder / TextDecoder)
- Size overhead
- ≈ 4/3 of the input (+33%)
- Line wrapping
- Optional, 76 characters (MIME)
- File limit
- 25 MB
- Processing
- In your browser, chunked
Privacy
Text and files are encoded and decoded in your browser. Nothing is uploaded or stored. Remember that Base64 is not encryption.
Read the full privacy policy.
FAQ
Base64 Encoder & Decoder questions
Base64 is a way of writing any data — text, images, files — using only 64 safe characters (A–Z, a–z, 0–9, + and /). It's used to put binary data where only text is allowed, such as email attachments, data URLs and JSON. ZSpace Tools' Base64 Encoder & Decoder converts text and files in both directions.
Text is first converted to UTF-8 bytes with the browser's TextEncoder — so Hindi, Arabic, Chinese and emoji encode correctly, unlike calling btoa() on the raw string. Every 3 bytes become 4 Base64 characters, which is why encoded data is about 33% larger. Decoding validates the alphabet, padding and length, accepts the URL-safe variant (- and _), and only shows text if the bytes are valid UTF-8; otherwise it tells you the data is binary and lets you download it as a file.
Embedding images in HTML or CSS as data URLs, sending attachments in email, storing binary data in JSON or XML, and encoding parts of tokens such as JWTs.
No. Base64 is an encoding that anyone can reverse instantly. Never use it to protect passwords or confidential data — use proper encryption instead.
Base64 uses 4 characters for every 3 bytes, so encoded data is about 33% larger, plus a little padding.
btoa() only accepts characters with codes up to 255. Text must first be converted to UTF-8 bytes, which this tool does automatically.
A variant that replaces + with - and / with _, and usually omits the = padding, so it can be used in URLs and filenames without further encoding.
Yes. Use File mode to encode any image and copy the Base64 or a ready-made data URL. You can also paste Base64 to download the image again.
Related tools
URL Encoder & Decoder
Percent-encode or decode URLs and query parameters, including Unicode and emoji.
JSON Formatter & Validator
Beautify, minify and validate JSON, with exact line and column for every error.
CSV to JSON & JSON to CSV Converter
Convert CSV to JSON or JSON to CSV, with delimiter detection, nested-data flattening and a preview.