Encode text and files to Base64, or decode Base64 back to the original — instantly, right in your browser.
URL-safe Base64 replaces + and / with - and _ and strips padding, so the output is safe to use in URLs and filenames.
Base64 turns any text or binary file into a safe, plain-text representation made up of letters, digits, and a few symbols. It's commonly used to embed images in CSS or HTML, send binary data in JSON or XML, and pack files into email attachments. This tool encodes and decodes Base64 entirely in your browser, so your data never leaves your device.
What is Base64 encoding?
Base64 is a way of representing binary data (or text) using only 64 printable ASCII characters: A–Z, a–z, 0–9, +, and /. It's designed so binary data can be safely transmitted through text-based systems like email and JSON without corruption.
Is Base64 the same as encryption?
No. Base64 encoding is not encryption — it provides no security or confidentiality. Anyone can decode Base64 text instantly, since it uses a fixed, publicly known alphabet. Use it for data formatting, never for protecting sensitive information.
What is URL-safe Base64?
Standard Base64 uses + and / characters and = padding, which have special meaning in URLs. URL-safe Base64 replaces + with -, / with _, and removes the padding, so the result can be used directly in a URL path or query string.
Why does decoding say my Base64 is invalid?
Usually one of three things: characters were lost or added when copying; the text uses the URL-safe alphabet (- and _), so turn on URL-safe before decoding; or the Base64 holds a binary file such as an image. Decode mode outputs UTF-8 text only, so binary data can’t be shown.
Can I encode a whole file, not just text?
Yes. Switch to File mode, drop in a file up to 5 MB, and this tool will convert its raw bytes into a Base64 string or a ready-to-use data URI you can paste directly into HTML or CSS.
Why is my Base64 output longer than the input?
Base64 encodes every 3 bytes of input as 4 characters of output, so encoded data is roughly 33% larger than the original. This overhead is the trade-off for representing arbitrary binary data as plain text.
Everything happens locally in your browser using built-in Web APIs. Your text and files are never uploaded to any server.