Base64 Converter
Base64 encodes binary data or text as 64 printable ASCII characters (A-Z, a-z, 0-9, + and /), so it can travel safely through email, JSON and URLs. Every 3 bytes become 4 characters, making output about 33% larger. This converter encodes and decodes UTF-8 text instantly, including accents and emoji.
TWVldCBhdCB0aGUgY2Fmw6kgYXQgNjozMA==
How to use the Base64 Converter
- Choose Encode or Decode.
- Type or paste your text, or a Base64 string when decoding, in the Input box.
- The result updates as you type. If a Base64 string is invalid, you see a clear error instead of garbled text.
- Press Copy to put the result on your clipboard.
Formula
3 bytes (24 bits) → 4 characters of 6 bits each, padded with =Text is first encoded as UTF-8 bytes, then every 6 bits map to one character of the standard Base64 alphabet (RFC 4648). Decoding reverses the process and reads the bytes back as UTF-8, so non-English characters survive the round trip.
Common uses
- Embedding small images and fonts in HTML or CSS as data: URIs
- Email attachments (MIME)
- Sending binary data in JSON APIs and configuration files
- HTTP Basic authentication headers
- JSON Web Tokens, which use the URL-safe variant
Standard and URL-safe Base64
Standard Base64 uses + and /, which have special meanings in URLs and file names. The URL-safe variant (base64url) replaces + with - and / with _ and often drops the = padding. Convert between them by swapping those characters.
Base64 Converter questions
What is Base64 encoding used for?
Base64 lets binary data travel through systems that only handle text. Typical uses are email attachments, images embedded as data URIs in HTML and CSS, binary fields in JSON APIs, Basic authentication headers and the parts of JSON Web Tokens.
Is Base64 a form of encryption?
No. Base64 is an encoding, not encryption, and anyone can decode it instantly without a key. Never use it to hide passwords or personal data. If you need confidentiality, encrypt the data first and then Base64-encode the ciphertext if it must be sent as text.
Why does Base64 make data bigger?
Base64 represents every 3 bytes as 4 characters, so the output is about 33% larger than the input, plus up to two = padding characters. A 30 KB image becomes about 40 KB as a data URI, which is why Base64 suits only small assets.
When should I use URL-safe Base64?
Use URL-safe Base64 (base64url) when the encoded value goes into a URL, a file name or a token. It replaces + with - and / with _, and usually omits = padding, so the value does not need extra escaping. JSON Web Tokens always use it.
What do the = signs at the end mean?
They are padding. Base64 works in groups of 3 bytes, and when the input length is not a multiple of 3, one or two = characters fill the last group of 4. They carry no data, and some systems, including base64url, leave them out.
Why does my decoded text look garbled?
Either the input is not valid Base64, or the original bytes were not UTF-8 text, for example an image or a file in another character encoding. This tool decodes as UTF-8 and shows an error when the Base64 itself is malformed.