toolhq.io

Base64 Encode / Decode

Convert text to and from Base64 with correct UTF-8 handling and a URL safe option.

Plain text
Base64
Output appears here as you type.

About the Base64 Encode / Decode

Base64 is a way of representing binary data using only 64 safe characters: letters, digits, plus, and slash. It is everywhere in web development. HTTP basic authentication headers, data URIs for inline images, JWT segments, email attachments, and many API payloads all use it. This tool converts text to Base64 and back, live, as you type.

Unlike the bare btoa function in JavaScript, this tool handles UTF-8 correctly. Emoji, accented characters, and any non Latin script encode and decode without corruption, because the text is converted to UTF-8 bytes before encoding rather than being treated as Latin-1.

The URL safe option produces the variant used in JWTs and URL parameters: plus becomes minus, slash becomes underscore, and the trailing padding is removed. When decoding, both standard and URL safe input are accepted automatically, and missing padding is tolerated, so you can paste a JWT segment directly.

Keep in mind that Base64 is an encoding, not encryption. Anyone can decode it. It exists to move data safely through systems that expect plain text, not to hide anything. Everything this tool does happens in your browser, so the text you paste is never uploaded anywhere.

Your ad could be here

Reach developers and designers who use these tools every day. Privacy-first, no trackers.

Frequently asked questions

Is Base64 encryption?

No. Base64 is a reversible encoding that anyone can decode in milliseconds with no key or password, including with this page. Its job is transport, not secrecy: it represents arbitrary bytes using 64 safe text characters so binary data survives systems built for plain text, such as email bodies, JSON strings, data URIs, and HTTP headers. Encryption, by contrast, requires a secret key to reverse, and without the key the output reveals nothing. The confusion persists because Base64 output looks scrambled to a human, but looking scrambled and being secret are different properties. Storing passwords, API keys, or personal data in Base64 and calling it protected is a real and recurring security mistake; anyone who obtains the string simply decodes it. If data needs to stay confidential, encrypt it with a real algorithm such as AES, and use Base64 afterwards only if the encrypted bytes must travel as text.

What is URL safe Base64?

Standard Base64 uses + and /, which have special meaning in URLs. The URL safe variant replaces + with - and / with _, and usually drops the = padding. JWTs and many web APIs use this variant. This tool can produce it and decodes both variants automatically.

Why does my decoded text look like garbage?

Either the input is not actually Base64, or it is valid Base64 that encodes binary data rather than text. Base64 can carry any bytes: an image, a PDF, a zip archive, or ciphertext all encode to perfectly valid Base64, and decoding them yields the original binary bytes, which have no meaningful text representation and render as random symbols. If you expected readable text, check where the data came from. A common case is a JWT: each of its three dot separated segments is Base64 encoded separately, so decoding the whole token at once produces garbage while decoding one segment yields JSON. Another is double encoding, where Base64 was applied twice and one decode pass reveals another Base64 string; decode again. Finally, text encoded on another system in a legacy character set rather than UTF-8 can decode into mangled accented characters, which is an encoding mismatch rather than corruption.

Does this tool handle emoji and non English text?

Yes. Text is converted to UTF-8 bytes before encoding and decoded back from UTF-8, so emoji, Chinese, Arabic, accented characters, and every other script round trip correctly.

Is my data sent to a server?

No. Encoding and decoding run entirely in your browser using the standard TextEncoder and TextDecoder APIs. Nothing you paste here leaves your machine.