Base64 encode and decode
Convert text to Base64 and back with correct UTF-8, or turn a file into Base64 or a data URI, and a Base64 string back into a file.
Your data never leaves your browser
Paste API responses and tokens safely: nothing is sent anywhere.
Input
Output
Next, try one of these tools
How to use
- 1Choose Text or File, then Encode or Decode.
- 2Paste or type your input. The result appears at once.
- 3Turn on the URL-safe alphabet if you need it for links or tokens.
- 4Copy the result or download it as a file.
Common uses
Embedding a small image
Turn an icon into a data URI and paste it into CSS or HTML.
Reading an encoded value
Decode a Base64 string from a config or an API response to see what it holds.
Basic auth and headers
Encode user:password text for a header while testing an API.
Saving an attachment
Turn a Base64 string from an email or a log back into the original file.
Tips and limits
- Base64 is not encryption. Anyone can decode it, so never use it to hide secrets.
- It makes data about one third bigger. Embed only small files as data URIs.
- If decoding gives unreadable characters, the data is probably a file, not text. Use File mode or the download button.
- URL-safe Base64 is what JWTs and many web APIs use. It replaces + and / so the string is safe in a link.
Base64 that handles Arabic, emoji and files
Base64 turns bytes into plain text so they can travel through places that only accept text: JSON bodies, headers, data URIs and config files. Many simple converters break on anything beyond English letters. This one encodes text as UTF-8 first, so Arabic, emoji and symbols round-trip exactly. Switch to the URL-safe alphabet (a dash and an underscore instead of plus and slash), with or without equals padding, and the tool notices when your input already looks like Base64 and offers to decode it.
File mode turns any file up to 25 MB into Base64 or a data URI with the right MIME type, and does the reverse: paste Base64 or a data URI and the tool detects the file type from its first bytes, previews images and lets you download the file. Base64 appears inside tokens too: the first two parts of a JWT are Base64URL, as described in what a JWT is, and you can read them directly with the JWT decoder. Percent-encode query values with URL Encode, and verify a download with the hash generator.
Step-by-step guides
Frequently asked questions
How do I encode text to Base64?
Choose Encode, type or paste your text, and copy the result. Arabic, emoji and other Unicode text are handled correctly.
How do I decode Base64?
Choose Decode and paste the string. If it is valid text you see it; if it is a file, use the download button.
What is URL-safe Base64?
A variant that uses - and _ instead of + and / so the result can sit in a URL without extra escaping.
Can I convert a file to Base64?
Yes. Use File mode, choose a file up to 25 MB and copy the Base64 or the full data URI.
Is my data uploaded?
No. Conversion happens in your browser, so text and files stay on your device.