Base64 is the universal translator that lets binary data and awkward text travel through systems built for plain ASCII: email attachments, data URIs in CSS, API tokens, embedded images and countless config formats. This tool encodes any text into Base64 and decodes Base64 strings back into readable text, both directions in the same place. It is fully UTF-8 aware, so accented characters, non-Latin scripts and emoji encode correctly instead of breaking the way naive encoders do, and it offers the URL-safe variant (using – and _ instead of + and /) that tokens and query strings require. Paste, convert, copy — with everything computed in your browser, which matters when the string you are decoding contains credentials.
Quick Answer: Paste text to encode it to Base64, or paste Base64 to decode it — Unicode-safe both ways, with an optional URL-safe alphabet.
Free Online Tool
Base64 Encoder / Decoder
The internet’s favourite disguise for text, applied and removed.
How to Use the Base64 Encoder / Decoder
- Choose Encode or Decode depending on which way you are going.
- Paste your text or Base64 string into the input box.
- Tick URL-safe if the output will live in a URL or token (it swaps + and / for – and _).
- Press Convert and review the output.
- Copy the result; if decoding fails, the error explains what was wrong with the input.
Key Features
- Two-way conversion with correct UTF-8 handling in both directions.
- URL-safe Base64 option for tokens, links and filenames.
- Clear errors for malformed Base64 instead of silent garbage.
- One-click copy and instant conversion as you type.
- Local processing only — decode tokens and credentials safely.
Best Practices and Tips
- Base64 is an encoding, not encryption: anyone can decode it, so never treat a Base64 token as a secret by itself.
- If a decoder elsewhere chokes, look for missing padding — Base64 length should be a multiple of four, with ‘=’ padding at the end.
- URL-safe matters: a single ‘+’ in a query string is read as a space by many servers and corrupts the value.
- Data URIs for small images use standard Base64 after the ‘data:image/png;base64,’ prefix.
- Encoded output is about a third longer than the input; that overhead is the price of ASCII safety.
Common Mistakes to Avoid
- Trying to decode a string that was never Base64 — random hex or a JWT segment with URL-safe characters needs the right mode.
- Double-encoding by accident when a value passes through two systems that each encode it.
- Assuming decoded gibberish means the tool is broken; usually the input was truncated when copied.
- Storing passwords ‘protected’ by Base64 — it is readable by anyone in milliseconds.
Frequently Asked Questions
What is Base64 used for?
It represents binary or arbitrary text using 64 safe ASCII characters. Email attachments (MIME), embedded images (data URIs), basic-auth headers, JWT parts and many API formats all rely on it to move data through text-only channels intact.
Why does my text get longer when encoded?
Base64 packs three bytes of input into four output characters, so the result grows by roughly 33%. That fixed overhead buys compatibility with systems that cannot handle raw bytes or special characters.
What does URL-safe mean?
Standard Base64 uses ‘+’ and ‘/’, which have special meanings in URLs. The URL-safe variant replaces them with ‘-‘ and ‘_’ and often drops padding, so the string survives being pasted into an address bar, query string or filename.
Can it encode files or images?
This tool converts text. For images, use the Image to Base64 converter on this site, which reads the file and produces the full Base64 string (and a ready-made data URI) for you.
Is it safe to decode tokens here?
Yes — conversion happens with JavaScript in your own browser tab and nothing is transmitted. That makes this page a safe place to inspect tokens, headers and encoded configuration values.
Related Tools
- URL Encoder / Decoder – percent-encodes URL text and decodes it back safely
- Image to Base64 Converter – turns an image file into a Base64 string and a ready data URI
- JWT Decoder – decodes JWT headers and payloads into readable JSON, locally
- SHA-256 Hash Generator – creates SHA-256 fingerprints of text using the Web Crypto API