Base64 Encode / Decode
Encode and decode Base64, Hex, URL, HTML, ROT13 & Binary.
Base64 is a way of writing binary data using only plain text characters, so it can travel safely through systems that expect text — and a Base64 encoder converts text or files into that form, or back again. This is a fast, two-way encoder/decoder for Base64, Base64 URL, Hex, URL, HTML entities, ROT13 and Binary, with a one-click swap. Runs fully in your browser — encoding is not encryption.
How to use Base64 Encode / Decode
Choose a scheme
Pick from seven schemes — Base64, Base64 URL, Hex, URL, HTML entities, ROT13 or Binary — to tell this free online encoder and decoder how to convert your text.
Set the direction
Switch between Encode and Decode so you can turn plain text into Base64 instantly, or paste a Base64 string and decode it back to the original.
Enter your text
Type or paste your content into the input box and the converted result appears live in the output panel as you work, entirely in your browser.
Read the output
The encoded or decoded result updates instantly, and any malformed input that cannot be decoded is flagged with a clear, friendly error message.
Swap input and output
Hit the one-click Swap button to feed the current result back as input and flip the direction, perfect for round-tripping a Base64 encode then decode.
Copy the result
Use the copy button to grab the encoded or decoded text for JSON, data URLs, JWTs, email attachments or escaping characters in links and HTML.
Frequently asked questions
What is a Base64 encoder and decoder used for?
A Base64 encoder and decoder converts text and data into the Base64 format and back again. It is widely used to embed images as data URLs, send binary in JSON or email attachments, store JWT payloads and safely transmit data that must travel as plain ASCII text.
How do I decode a Base64 string back to text?
Paste the Base64 string into this free online Base64 decoder, choose the Base64 scheme and set the direction to Decode — the original text appears instantly. Because Base64 is lossless, anything that was encoded can be decoded back exactly.
What is the difference between Base64 and Base64 URL encoding?
Standard Base64 uses the + and / characters and = padding, which can break inside URLs. Base64 URL encoding replaces + and / with - and _ and drops padding, making the result safe to use in query strings, tokens and filenames.
Is Base64 encoding the same as encryption?
No. Base64 encoding is not encryption — it only re-represents data and anyone can decode it back instantly. Never use Base64 or any encoding to hide passwords or secrets; for passwords use bcrypt and for secure fingerprints use a hash generator.
Can I encode and decode URLs, Hex, HTML entities and ROT13 here?
Yes. Besides Base64 and Base64 URL, this tool supports two-way URL encoding, Hex, HTML entity escaping, ROT13 and Binary. Pick the scheme, choose Encode or Decode, and use the one-click Swap button to flip between them.
Is this Base64 converter free and does my data stay private?
Yes, it is completely free and private. All encoding and decoding run 100% in your browser, so nothing you type is uploaded to a server. You can convert text and data offline once the page has loaded.
When should I use URL encoding versus HTML entity encoding?
Use URL encoding to escape characters like spaces and & in links and query parameters, and HTML entity encoding to safely display characters such as <, > and & inside HTML without breaking the markup. This tool handles both directions for each.
How do I encode an image or file to Base64?
This tool encodes text and data to Base64. To inline a picture as a data URL, use our dedicated Image to Base64 tool, which reads the file and outputs a ready-to-paste data:image/... string. For plain text or already-encoded bytes, paste them here and choose Encode.
What is ROT13 and when is it used?
ROT13 is a simple letter-substitution cipher that shifts each letter 13 places, so applying it twice returns the original text. It's not secure — it's used to lightly obscure spoilers, puzzle answers or offensive words so they aren't read by accident. Pick ROT13 here and Encode or Decode to apply it.
Related tools — Security & Encoding
- Password Generator — Secure random passwords & memorable passphrases.
- Hash Generator — MD5, SHA-1, SHA-256, SHA-384 & SHA-512 of text or files.
- Password (bcrypt) — Generate & verify salted bcrypt password hashes.