Base64 Encoder & Decoder - Free Online Tool
What is a Base64 encoder/decoder?
A Base64 encoder/decoder turns binary or text data into a 64-character alphabet so it can travel through systems that only accept text. It also reverses the process, returning the original content. Use it when you need to move tokens, small images, or configuration values through URLs, JSON, or email without corruption. This tool runs locally, so nothing leaves your device.
How to use the Base64 encoder/decoder
- Paste your input: Add plain text to encode or a Base64 string to decode. The tool handles any length and supports Unicode.
- Pick the direction: Choose Encode or Decode.
- Get results: The output appears instantly. Copy it or download as a text file for use in code or configs.
Why use this Base64 tool?
- Safe transmission: Protects binary or special characters when sending data through text-only channels.
- Developer friendly: Validate API payloads, email attachments, and data URIs without opening a terminal.
- Local privacy: All work stays in your browser, so secrets like API keys remain private.
Use case 1: Embed small assets
Convert an icon to Base64 and drop it into a CSS or HTML data URI to avoid extra requests.
Use case 2: Move tokens in requests
Encode session tokens before adding them to URLs or JSON to avoid breaking characters.
Use case 3: Email attachments
Quickly decode a Base64 email attachment string to verify its contents without saving files.
Examples
Basic example
Input (encode): Hello, World!
Output: SGVsbG8sIFdvcmxkIQ==
Advanced example
Input (encode): {"message":"Hello 世界","emoji":"🌍"}
Output: eyJtZXNzYWdlIjoiSGVsbG8g5LiW55WMIiwiZW1vamkiOiLwn4yNIn0=
Common errors
Invalid Base64 string
If decoding fails, remove spaces or line breaks and ensure only A–Z, a–z, 0–9, +, /, and = appear. For URL-safe strings, switch to the URL-safe option.
Garbled decoded text
Mismatched character encoding can scramble output. This tool uses UTF-8; re-encode your source in UTF-8 and try again.
Tips and proven approaches
- Expect about 33% size growth after encoding; avoid it for large binaries.
- For URLs, use the URL-safe alphabet (- and _) to prevent escaping.
- Validate secrets before storing by decoding once to confirm the content.
Related tools
- Encode query strings with the URL encoder/decoder.
- Compress data first, then encode with the JSON minifier to shrink payloads.
- Format API responses with the JSON formatter before encoding.
Privacy and security
Encoding and decoding happen entirely in your browser. No inputs or outputs are sent to servers, so keys, tokens, and files stay private.