Base64 Encode / Decode
Encode text to Base64 or decode it back. UTF-8 safe, runs in your browser. Nothing is uploaded.
How to use Base64 Encode Decode
- Paste or type your text into the Input box.
- Optionally tick URL-safe Base64 if you need
-and_instead of+and/(handy for query strings and tokens). - Click Encode to turn text into Base64, or Decode to turn Base64 back into text.
- Use Copy output to place the result on the clipboard, Swap in ↔ out to move the result back into the input, or Clear to start again.
If you enjoy what we do, consider supporting us. Every little bit means the world! Support Catpool on Ko-fi
What it is for
Base64 is a way of representing binary or arbitrary text using a limited set of ASCII characters. Developers use it when embedding small data in JSON, HTML data URLs, email (MIME), configuration files, or HTTP headers where raw bytes would break. Encoding does not encrypt or hide secrets, since anyone can decode Base64, but it does make awkward characters travel safely through systems that expect plain text.
Typical jobs include encoding a short string for a data URI, decoding a token you were given in a tutorial, or checking that a payload still round-trips after copy and paste. If you are tidying structured data rather than opaque strings, the JSON Formatter sits in the same browser-only toolkit.
Why it runs in your browser
Encoding and decoding happen on your device with the Web Crypto-friendly TextEncoder / TextDecoder path and standard Base64 helpers. Your input is not uploaded to Catpool’s servers, which matters when the string contains API keys, sample customer data, or draft credentials you would rather keep local.
Tips
Favour UTF-8 text for everyday use: emoji and non-English characters encode correctly here. When decoding, strip stray line breaks if a source wrapped the string; this tool ignores whitespace. If decode fails, try toggling URL-safe mode: some services omit padding (=) and swap symbols.
How Base64 works, with an example
Base64 takes your text three bytes at a time, which is 24 bits, and splits them into four groups of six bits. Each group becomes one of 64 characters: A to Z, a to z, 0 to 9, plus + and /. That is where the name comes from.
Catis exactly three bytes, so it encodes to four characters:Q2F0.Hellois five bytes, so the last group is padded:SGVsbG8=.Hiis two bytes and needs one padding sign:SGk=.
Because every three bytes become four characters, Base64 is about a third bigger than the original. That is fine for a short token or a small icon in a data URL, but it is why large files are rarely sent this way. The = signs at the end are padding that brings the length up to a multiple of four, and some systems leave them off.
Common questions
Is Base64 encryption?
No. It is an encoding. Anyone with the string can decode it. Do not treat Base64 as a way to protect passwords or personal data.
What is URL-safe Base64?
Standard Base64 uses + and /, which can be awkward in URLs. The URL-safe variant uses - and _ instead, and often drops padding. Tick the checkbox when you are working with that flavour.
Why did decode show an error?
Invalid characters, a truncated string, or the wrong URL-safe setting usually cause it. Double-check the source, remove unexpected punctuation, and try again.
Does it handle Unicode?
Yes. Text is treated as UTF-8 before encoding and after decoding, so accented letters and emoji survive a round trip.
Can I encode files?
This page is aimed at text. For binary files you would normally use a dedicated file encoder or a build step; paste only text you are comfortable viewing in a textarea.
Related: JSON Formatter, URL Encode/Decode, Developer, Catpool home.
