Base64 Encoder / Decoder
Encode text and files to Base64 and decode back, with UTF-8 support. Handles line breaks, missing trailing equals signs, the URL-safe variant and data: prefixes.
0 characters ยท 0 bytes
Base64
What the tool does
Base64 writes any bytes with 64 characters: letters, digits, "+" and "/". This is how a binary file or text in a non-Latin alphabet travels where a plain string is expected: inside JSON, in an email, in an image URL within CSS.
Text is first converted to UTF-8 bytes and only then to Base64. Cyrillic, symbols and emoji come back character for character.
What counts as input
A Base64 string rarely arrives clean, so the tool tolerates line breaks and spaces inside it, a string without the trailing "=" padding, the URL-safe variant with "-" and "_", and a data:โฆ;base64, prefix.
If the string is broken, you don't get an empty field. The tool points to the break: the line and column where an invalid character appeared.
Files
You can drag a file onto the page or pick one with a button. Its bytes are encoded to Base64; the result can be copied or downloaded as a .txt file. In the other direction, the tool accepts a file containing a Base64 string. A file is encoded up to 50 MB, and a Base64 string inside a file is read up to 70 MB.
The decoded result is not always text
A Base64 string often holds an image or a PDF. When the bytes don't add up to valid UTF-8 text, the tool names the file type, its size and the first bytes in hexadecimal. No garbled characters instead of a picture. The file itself can be downloaded, with the extension chosen by its content.
Rate this tool
Help us get better
Tell us what was missing.
Other tools
JSON Formatter
Format and repair JSON in the browser, flagging duplicate keys and long numbers
Regex Tester
Regex testing with a plain-language breakdown and hang protection
JWT Decoder
JWT parsing with fields explained and signature verification
CSV to JSON
A table to JSON with honest types and a reverse check
JSON to CSV
JSON to a table for Excel, with verification and formula protection
SQL Formatter
A readable query layout, verified against the source, with risky spots flagged
XML Formatter
Readable XML, errors explained with a hint, verified against the source
XML Validator
Markup, XSD schema, sitemap, YML and RSS rules, with the path to each error