Encode or decode Base64
Encode text to Base64 or decode Base64 back to text, UTF-8 safe, with a URL-safe option.
0 / 2,000,000 characters · Updates as you type.
Base64 turns any bytes into 64 printable ASCII characters so they survive systems that only handle text: email bodies, JSON fields, HTTP headers, data URLs. Every three bytes become four characters, so the encoded form is about 33% larger than the original.
The classic browser functions btoa and atob only work on Latin-1 characters and throw on anything else. This tool encodes the text as UTF-8 first, so Arabic, Chinese, emoji and accented letters round-trip correctly. The URL-safe variant (RFC 4648 section 5) swaps + and / for - and _ and drops the trailing = padding; it is what JWTs, OAuth state parameters and many APIs use. Decoding accepts either alphabet, with or without padding, and ignores whitespace.
How to use it
- Choose the direction: encode text to Base64, or decode Base64 back to text.
- Paste your input. The result updates as you type.
- For encoding, turn on URL-safe if the value goes into a URL or a JWT.
- Copy the output or download it as a text file.
Frequently asked questions
Is Base64 encryption?
No. Anyone can decode it instantly; it hides nothing. Use it only for transport, never to protect secrets.
Why does decoding show strange characters?
The Base64 probably encodes binary data (an image, a compressed file) rather than text, or text in an encoding other than UTF-8. Bytes that are not valid UTF-8 are shown as replacement characters.
Can I decode a data URL?
Paste only the part after the comma (after "base64,"). The prefix "data:image/png;base64," is not Base64 and will be rejected.
What about line breaks every 76 characters?
MIME-style Base64 wraps lines at 76 characters. The decoder ignores all whitespace, so wrapped input works. The encoder produces a single line.
Related tools
- URL-encode or decode textPercent-encode text for URLs (encodeURIComponent or encodeURI) or decode an encoded string.
- Decode a JWT (without sending it anywhere)Decode a JSON Web Token's header and payload and see whether it has expired. Signature is not verified; the token stays in your browser.
- Format, beautify or minify JSONPretty-print or minify JSON with 2-space, 4-space or tab indentation and optional key sorting.
- Generate UUIDs (v4 or v7)Generate 1 to 100 random UUID v4 or time-ordered UUID v7 identifiers with crypto-grade randomness.
- Generate a QR code (PNG or SVG)Turn a URL or text into a QR code and download it as PNG or SVG. Generated locally; nothing is uploaded.