Base64 and URL — Encode / Decode
Encode and decode text in Base64 or URL encoding (percent-encoding), with full support for accented characters and emojis (UTF-8).
Encode and decode text in Base64 or URL encoding (percent-encoding), with full support for accented characters and emojis (UTF-8).
Base64 is an encoding scheme that represents binary data using only 64
"safe" ASCII characters (A–Z, a–z, 0–9, + and /). It is used
when binary data needs to travel through channels that only accept text — such as email
attachments, data URIs in CSS/HTML, tokens (the header and payload of a JWT
are Base64URL) and JSON fields. Encoding in Base64 is not encryption:
anyone can decode it. It increases the data size by about 33%.
URL encoding (or percent-encoding) replaces characters that
have special meaning or are not allowed in a URL with % followed by the
hexadecimal code of the byte. For example, a space becomes %20 and
ã becomes %C3%A3. It is essential when building query strings
and sending data in URLs. This tool uses encodeURIComponent in URL mode,
suitable for encoding individual parameter values.
The browser's native btoa/atob functions operate only on
8-bit (latin1) characters and break with accented characters or emojis. This tool
handles that by passing the text through encodeURIComponent before
encoding in Base64 — so "hi 👋" is encoded and decoded correctly, without
corrupting the characters.
No. Base64 is just a reversible encoding, with no key or secret. Anyone can decode it. Never use Base64 to "hide" passwords or sensitive data.
In Base64 mode, the error appears when the text contains characters that don't belong
to the Base64 alphabet or has an invalid length. In URL mode, the error appears when
there is a malformed % sequence (e.g., %ZZ or a stray
%). Check whether you pasted the complete content and in the correct mode.
encodeURIComponent encodes practically all special characters, making it
ideal for query parameter values. encodeURI preserves structural
URL characters (such as /, ? and &), serving
to encode an entire URL. This tool uses encodeURIComponent.