# Base64 Encode & Decode - Free, Local

Page: https://hirantha.me/tools/base64
Part of: Hirantha Sandaruwan Lakshan free tools (https://hirantha.me/tools)
Updated: 2026-07-31

Convert text to Base64 and back, right in your browser.

This is a free tool that runs in the browser: open the page to use it. File tools process files on the visitor's own device; files are never uploaded or stored. No account, sign-up, payment or watermark.

Encode text to Base64 or decode a Base64 string back to text, entirely in your browser. Handles full Unicode text correctly, not just plain ASCII.

Base64 represents binary data using 64 printable characters, which is why it's commonly used to embed binary-ish content, like an image or a token, inside text formats such as JSON or a URL.

Text is first converted to UTF-8 bytes before encoding, and decoded bytes are interpreted back as UTF-8, so accented letters, emoji, and other non-ASCII characters round-trip correctly rather than becoming garbled.

Decoding a string that isn't valid Base64 fails with a clear message rather than silently returning corrupted output.

Q: Is my text uploaded anywhere?
A: No, encoding and decoding both happen entirely in your browser tab.

Q: Does this handle emoji and accented characters?
A: Yes - text is encoded as UTF-8 before Base64 conversion, so non-ASCII characters decode back correctly.

Q: What happens if I paste invalid Base64 to decode?
A: A clear error is shown rather than silently returning garbled or empty output.

Q: Is Base64 the same as encryption?
A: No - Base64 is just a reversible text encoding with no secret key, not a way to protect data. Anyone can decode it.

Q: Why does Base64 make my data bigger?
A: It represents every 3 bytes as 4 text characters, so the output is about 33% larger. That's the cost of making binary data safe to put in text-only places.

Q: What is URL-safe Base64?
A: A variant that swaps the + and / characters for - and _, so the result can go in a URL without being percent-encoded again. JWTs use it.

Q: Can I Base64 encode an image or file?
A: This tool handles text. Encoding a file is the same idea, but it's usually done as a data URI in code rather than by hand.

Q: Why does my Base64 string end in equals signs?
A: Padding. Base64 works in blocks of three bytes, and = marks where the final block was short. It carries no data.

Sources: Base64 - Wikipedia (https://en.wikipedia.org/wiki/Base64); Window: btoa() method - MDN (https://developer.mozilla.org/en-US/docs/Web/API/Window/btoa)

Related tools:

- [URL encode & decode](https://hirantha.me/tools/url-encoder.md): Percent-encode text for a URL, or decode it back.
- [JSON formatter & validator](https://hirantha.me/tools/json-formatter.md): Pretty-print, minify, and validate JSON with clear error locations.
- [Image to Base64 converter](https://hirantha.me/tools/image-to-base64.md): Turn an image into a Base64 string, data URI, HTML tag or CSS snippet, or decode Base64 back into a picture. Runs in your browser, nothing is uploaded.
- [Text to binary converter](https://hirantha.me/tools/text-to-binary.md): Turn text into binary, hexadecimal, octal or decimal bytes, and bytes back into text. UTF-8 aware, with an ASCII table and clear errors.
- [HTML entities encoder and decoder](https://hirantha.me/tools/html-entities-encoder.md): Encode text to HTML entities as names, decimal or hex and decode them back, with all 2,125 named references of the HTML standard and a table of the common ones.
- [Number base converter](https://hirantha.me/tools/number-base-converter.md): Convert whole numbers between binary, octal, decimal, hex and any base from 2 to 36 with exact BigInt maths, negatives, two's complement and step-by-step working.
