Free tool · runs in your browser
Base64 encoder and decoder
Encode text to Base64 or decode Base64 back to text, including emoji and non-English characters, with an optional URL-safe format.
Quick answer
Base64 turns any data into text made of 64 safe characters, so it can travel through systems that only handle text, such as JSON, URLs or email. It is an encoding, not encryption: anyone can decode it. URL-safe Base64 (Base64URL) replaces + and / with - and _ and drops the padding, which is what JWTs use.
How to use it
- Choose encode or decode. Encode turns text into Base64; decode turns Base64 back into text.
- Paste your input. Text in any language works, because it is converted as UTF-8.
- Pick URL-safe if needed. Use it for URLs, file names and JWTs.
Frequently asked questions
Is Base64 encryption?
No. Base64 only changes how data is written; anyone can decode it. Use real encryption for secrets.
Why does Base64 make data bigger?
Every 3 bytes become 4 characters, so encoded data is about 33% larger.
What is URL-safe Base64?
A variant that uses - and _ instead of + and /, and usually drops the = padding, so it can be used in URLs and file names.
Why does decoding give strange characters?
The input may not be text (for example an image), may not be valid Base64, or may use the URL-safe alphabet; try the URL-safe option.
Is my data uploaded?
No. Encoding and decoding run in your browser.
How do I encode Base64 in JavaScript?
btoa() works for ASCII text; for any UTF-8 text, convert it to bytes first with TextEncoder, as this tool does. In Node.js, use Buffer.from(text).toString("base64").
What is a data URL?
A way to embed a file directly in a page as Base64, such as data:image/png;base64, followed by the encoded data.
What is the = at the end of Base64?
Padding that makes the length a multiple of 4. URL-safe Base64 usually leaves it out.
Can I encode images or files here?
This tool encodes text. Files can be Base64-encoded too, but they become about a third larger.
Is standard Base64 safe to use in URLs?
No. It contains + and /, which have special meanings in URLs; use the URL-safe variant instead.