What Base64 is for
Base64 turns binary data into plain text made of letters, digits, + and /, so it can travel through systems that only handle text, such as JSON, email bodies, HTML data URIs and HTTP headers. It is an encoding, not encryption: anyone can reverse it, so never use it to hide secrets.
This tool encodes and decodes in your browser. Your text and files are not uploaded.
How to use it
Paste text and choose Encode to get the Base64 string, or paste a Base64 string and choose Decode to read the original. You can also work with files. Turn on URL-safe mode when the result will go into a URL or a JWT.
Example
Encoding the text Hello, World! gives:
Hello, World! → SGVsbG8sIFdvcmxkIQ==
URL-safe form replaces + with - and / with _, and often drops the = padding.Common Base64 problems
- Garbled characters after decoding: the original text was UTF-8 but was decoded as Latin-1. Make sure UTF-8 is used on both sides.
- Invalid string errors: stray spaces or line breaks, or a URL-safe string decoded as standard Base64 (or the reverse).
- Missing padding: some systems drop the trailing = characters. Standard decoders may need them added back.
- Larger output: Base64 makes data about one third bigger, so avoid it for large files when you can send raw bytes.
Where Base64 is used
Base64 turns binary data into plain text, which is why it appears in so many places:
- Data URLs, such as small images embedded in HTML or CSS.
- Email attachments, which travel as Base64 text inside the message.
- JSON Web Tokens, where the header and payload are Base64URL encoded.
- HTTP Basic authentication, where username and password are joined and Base64 encoded.
- Storing small binary values in JSON or XML, which cannot hold raw bytes.
Base64 is not encryption
Anyone can decode Base64 in a second, so it hides nothing. It only changes how data is written. Never use it to protect passwords, keys or personal data. If you need secrecy, encrypt first with a tool such as AES and then Base64 encode the encrypted result so it can travel as text. Base64 also makes data about 33 percent larger, so it is a poor choice for big files.
Related tools
- JWT Token Decoder: Decode JSON Web Tokens (JWT) locally in your browser. Inspect headers, payload, and signatures.
- URL Encoder / Decoder: Encode or decode URLs and query strings using percent-encoding, right in your browser.
- JSON Formatter & Validator: Format, validate, and beautify JSON with clear error messages for developers.
- Bulk SHA & MD5 Hash Generator: Generate MD5, SHA-1, SHA-256, and SHA-512 hashes in bulk from text or files.
