Encode text or files to Base64, or decode Base64 strings back to plain text. Supports URL-safe mode, image preview, file upload, and MIME line wrapping. Fast, free, and 100% client-side.
Base64 is a binary-to-text encoding scheme that converts binary data into a sequence of ASCII characters.
It uses a 64-character alphabet — uppercase letters A–Z, lowercase letters a–z, digits 0–9, plus + and / —
to represent any byte of data. Every 3 bytes of input are encoded into exactly 4 Base64 characters,
which means Base64 output is approximately 33% larger than the original input.
If the input isn't a multiple of 3 bytes, padding characters (=) are appended to complete the final group.
data:image/png;base64,... data URIs to eliminate extra HTTP requests.
Standard Base64 uses + and / as part of its alphabet. These characters have special meaning in URLs —
+ means a space, and / is a path separator. When a Base64 string needs to appear in a URL
(as a query parameter, path segment, or filename), these characters must be percent-encoded, making the string harder to work with.
URL-safe Base64 (defined in RFC 4648 §5) solves this by substituting - for +
and _ for /. Padding (=) is also typically dropped. The result is a string safe
to embed in URLs and filenames without any further encoding. Enable the URL-safe Base64 option on this tool to switch between the two variants.
No — Base64 is encoding, not encryption. It provides zero confidentiality: anyone can decode a Base64 string in seconds using any standard library or tool. It is purely a way to represent binary data as printable ASCII text. Never use Base64 to protect passwords, API keys, or sensitive personal data. For actual security, use proper encryption algorithms (AES-256, RSA) and established protocols (TLS).
Switch to the File tab to upload any file — images (PNG, JPG, GIF, WebP, SVG), PDFs, fonts, or any binary.
The tool reads the file client-side using the FileReader API and converts it to Base64 instantly without uploading it to any server.
If you upload an image, a live preview is shown alongside the encoded output.
The resulting data URI can be pasted directly into an HTML <img src="..."> attribute or a CSS background-image property.
The original MIME standard (RFC 2045) specifies that Base64-encoded data in email should be split into lines of no more than 76 characters. Enable the Wrap lines option to produce output in this format. This is useful when working with email systems, PEM certificates, or any protocol that requires fixed-width Base64 blocks. Modern web applications typically use unwrapped (single-line) Base64.
The Base64 string likely encodes binary data (an image, PDF, or other non-text file) rather than a plain-text string. Binary data cannot be displayed as readable text. If you know the original file type, save the decoded bytes as that file extension instead of reading it as text.
Base64 encodes 3 bytes at a time into 4 characters. If the input length is not divisible by 3,
one or two = padding characters are appended to make the output length a multiple of 4.
One = means 1 byte of padding was added; == means 2 bytes were padded.
URL-safe Base64 often omits this padding.
Base64 increases data size by approximately 33%. Every 3 bytes of input become 4 characters of output. For example, a 100 KB image becomes roughly 133 KB as a Base64 string. Keep this overhead in mind when deciding whether to inline images as data URIs — for large files, a separate HTTP request is usually more efficient.