The Free Base64 Tool
Encode text to Base64 or decode Base64 back to text — instantly, in your browser.
Supports Unicode and URL-safe Base64. Client-side only — your data never leaves the browser.
Input
Output
What is Base64?
Base64 is a binary-to-text encoding scheme that converts binary data into a sequence of 64 printable ASCII characters. It uses the characters A–Z, a–z, 0–9, and two additional characters (+ and /) to represent every possible byte value. The name comes from the 64-character alphabet used.
Base64 is widely used whenever binary data needs to travel through a text-only medium — embedding images in CSS as data URIs, encoding email attachments in MIME, passing binary payloads in JSON APIs, and generating JWT tokens. Base64 is not encryption; anyone can decode a Base64 string without a key.
// Standard Base64 SGVsbG8sIFdvcmxkIQ== → Hello, World! // URL-safe Base64 (no +, /, or = padding) SGVsbG8sIFdvcmxkIQ → Hello, World!
How to use this Base64 tool
-
1
Choose Encode or Decode
Select Encode to convert plain text to Base64, or Decode to convert a Base64 string back to text. The mode toggle updates the placeholder and direction instantly.
-
2
Toggle URL-safe if needed
Enable URL-safe Base64 to use - and _ instead of + and / — no = padding is added. Use this for URLs, filenames, JWT tokens, or any context where standard Base64 characters cause problems.
-
3
Paste or type your input
Enter text in the Input field. The result appears in the Output field instantly as you type. Unicode characters, emojis, and accented letters all work correctly.
-
4
Copy the result
Click Copy to copy the output to your clipboard. Use Swap to move the output back to the input and flip the mode — useful for a quick round-trip test.
Frequently asked questions
What is Base64 encoding? +
Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It is commonly used to embed binary data — like images or files — inside text formats such as JSON, XML, HTML, CSS, or email.
When should I use Base64? +
Use Base64 when you need to include binary data in a text-only context: embedding images in CSS (data URIs), encoding file attachments in emails (MIME), passing binary data in JSON APIs, or storing small assets inline in HTML. It is not a compression format — encoded data is about 33% larger than the original.
Is Base64 the same as encryption? +
No. Base64 is encoding, not encryption. It is fully reversible without any key or password. Anyone with the Base64 string can decode it immediately. Never use Base64 to protect sensitive data — use proper encryption algorithms like AES for that.
What is URL-safe Base64? +
Standard Base64 uses + and / characters that have special meaning in URLs. URL-safe Base64 (also called Base64url) replaces + with - and / with _ so the result can be safely used in URLs and filenames without percent-encoding. This variant is used by JWT tokens, for example.
Why does my Base64 string fail to decode? +
Common causes: missing or incorrect padding (Base64 strings must have a length divisible by 4, padded with = signs), presence of whitespace or line breaks, use of URL-safe characters (- and _) when the decoder expects standard characters (+ and /), or the string was not valid Base64 to begin with.
Does this tool handle Unicode and special characters? +
Yes. This encoder uses the TextEncoder API to convert your input to UTF-8 bytes before encoding, and TextDecoder to restore the original string on decode. This means emojis, accented characters, Chinese, Arabic, and all other Unicode text are handled correctly.
Is my data safe when using this tool? +
Yes. All encoding and decoding happens entirely in your browser using JavaScript. No data is ever sent to a server, stored, or logged. You can even use this tool offline after the page has loaded.
What is the difference between Base64 and Base64url? +
Both encode the same data using 64 characters. Standard Base64 uses + and / as the 62nd and 63rd characters and = for padding. Base64url substitutes - for + and _ for / and sometimes omits padding. This tool supports both variants via the URL-safe toggle.