Encode or decode Base64 text, ASCII and binary files. Runs in your browser; nothing is uploaded.
How to encode and decode Base64 (Text, ASCII & Files)
To encode text or files: paste any ASCII or UTF-8 text into Input and click Encode, or click Encode file… to convert a binary file (up to 25 MB) into Base64. For dedicated previews, see Image ↔ Base64, Audio ↔ Base64, Video ↔ Base64, and PDF ↔ Base64.
To decode Base64 to ASCII / UTF-8 text: paste a Base64 string or a data:...;base64, URI into Input and click Decode. Whitespace, line breaks, and URL-safe characters are accepted automatically, and the status bar indicates whether the decoded text is pure 7-bit ASCII or multi-byte UTF-8.
To save binary output (Base64 to File): when decoded bytes represent a binary file, click Download binary to save the reconstructed file with the matching extension.
Encoding options and RFC 4648 variants
URL-safe (-_): uses - and _ instead of + and / (RFC 4648 §5 Base64url), safe for URLs, query parameters, filenames, and JSON Web Token (JWT) segments.
Padding (=): includes or strips trailing = padding characters. The decoder accepts both padded and unpadded Base64 automatically.
Wrap lines (76 chars): splits the encoded output into 76-character lines per RFC 2045 MIME for email attachments and PEM blocks.
Data URI: prepends data:<mime>;base64, using the uploaded file's MIME type (or text/plain;charset=utf-8), ready to embed directly in HTML src attributes or CSS url(...) rules.
Frequently asked questions
What is the difference between standard Base64 and URL-safe Base64 (Base64url)?
Standard Base64 (RFC 4648 §4) uses + and / as its 62nd and 63rd characters, which have special meanings in URLs and file paths. URL-safe Base64 (RFC 4648 §5, also called Base64url) replaces + with - (hyphen) and / with _ (underscore), making it safe for query parameters, filenames, and JSON Web Tokens (JWT).
How does Base64 to ASCII differ from Base64 to UTF-8 text?
7-bit ASCII (bytes 0x00 to 0x7F) is a strict subset of UTF-8: every valid ASCII string is identical in UTF-8. When decoded bytes contain only 0x00–0x7F, the tool reports ASCII output; when multi-byte sequences are present, it decodes them as UTF-8.
Why does JavaScript btoa() fail on emojis or accented letters?
Built-in browser functions btoa() and atob() only accept single-byte Latin-1 characters (U+0000 to U+00FF) and throw an InvalidCharacterError on multi-byte Unicode text. This tool encodes strings as UTF-8 bytes first, so emojis, accented characters, and CJK scripts encode and decode cleanly.
How much does Base64 encoding increase file size?
Base64 represents every 3 bytes (24 bits) of input as 4 ASCII characters (32 bits), increasing the byte size by approximately 33% (plus ~4% more if 76-character MIME line breaks are enabled).
Is Base64 a form of encryption?
No. Base64 is a binary-to-text encoding scheme, not encryption. Anyone can decode a Base64 string without a key, so never use Base64 alone to hide passwords or secret tokens.