Base64 Encoder / Decoder
A base64 converter turns binary data — text, an image, any file — into plain ASCII text that's safe to embed in places that only accept text, and back again. Encode text, images and files to Base64, or decode Base64 back into text, an image preview, or a downloadable file — with URL-safe and Data URI output.
1 Choose input
Accepts standard Base64, URL-safe Base64, and full Data URIs — whitespace and line breaks are ignored automatically.
2 Result
Encode text or a file on the left to see the Base64 result here.
Where Base64 actually gets used
Base64 turns arbitrary binary data — an image, a font, a PDF, a small file — into plain ASCII text, which matters because a lot of systems (JSON payloads, email attachments, URL query parameters, CSS and HTML) are only designed to safely carry text. It's not encryption or compression; it's purely a format conversion, and it's trivially reversible by design.
In SEO and web work specifically, it shows up in inline Data URIs for small icons, Base64-encoded images inside JSON-LD or API responses, embedded fonts in CSS, and Basic Auth headers. When the input is a picture you want to convert to a Data URI, there's a dedicated page that previews it and copies it as a ready CSS rule or <img> tag. Knowing how to quickly encode or decode it — and see what's actually inside a Base64 blob — saves a trip to the browser console or a throwaway script. If the blob turns out to be a picture, a Base64 to image converter shows it straight away and downloads it with the right file extension. If what you're actually looking at is a JSON payload rather than binary data, the JSON Formatter & Validator is the more direct tool.
For example, the text "Frost Rank" encodes to:
RnJvc3QgUmFuaw==
How to use this tool
-
1
Pick a mode
Choose Encode to turn text or a file into Base64, or Decode to turn Base64 back into its original form.
-
2
Add your input
To encode, type text or switch the input type to File and choose a file. To decode, paste a standard Base64 string, a URL-safe string or a complete data: URI.
-
3
Set the output options
When encoding, turn on "URL-safe output" for strings that go into URLs or file names, or "Wrap as Data URI" for a ready-to-use data: link.
-
4
Check the result
The result updates as you type. Decoded text is shown directly, and a decoded image appears as a preview.
-
5
Copy or download
Copy the encoded string or decoded text, or download the file when the decoded data is an image or other binary content.
Common use cases
- Embedding a small icon or SVG directly in CSS or HTML as a data URI, saving a separate request.
- Reading the header and payload of a JWT while debugging authentication (both are URL-safe Base64, which the decoder accepts as-is). To decode a JWT online with its claims and expiry laid out for you, there's a dedicated page.
- Finding out what a Base64 image in an API response, email source or JSON file actually shows.
- Preparing binary data to travel inside a JSON body or an environment variable that only accepts text.
- Checking whether an odd-looking string in a URL or log file is readable data in disguise.
Tips and common mistakes
- Base64 is not encryption. Anyone can decode it in seconds, so never use it to hide passwords, API keys or personal data. For a real secret, create one with the Password Generator and store it properly.
- Keep data URIs small. Encoding adds about a third to the size, and an inlined file cannot be cached separately, so data URIs only pay off for assets of a few kilobytes. You can test one quickly in the HTML Viewer & Live Renderer.
- Know which variant you have. Standard and URL-safe Base64 differ only in two characters (
+ /versus- _) and in padding. The decoder handles both, but the system you paste the output into may not. - Expect longer output for non-English text. Text is encoded as UTF-8, where accented letters and emoji take more than one byte, so their Base64 is longer than the character count suggests. The Base64 encoding guide walks through why.
Frequently asked questions
Base64 is a binary-to-text encoding that represents any data, such as an image, a file or raw bytes, using 64 plain ASCII characters: A–Z, a–z, 0–9, + and /, with = for padding. It lets binary data travel through text-only places like JSON, email and Data URIs, and it's fully reversible, which this tool does in both directions. Read how Base64 encoding works, bit by bit.
No. Base64 is an encoding, not encryption: it uses no key or secret, and the method is public, so anyone can decode a Base64 string in seconds, this tool included. Use it to move data through text-only systems, and never to hide passwords, API keys or personal data, which need real encryption such as AES. See why Base64 is not encryption.
Yes, entirely — including files and images. Nothing you upload, paste or convert is ever sent to a server, which also makes it safe to use on files you wouldn't want to upload anywhere.
Standard Base64 uses "+" and "/" in its alphabet, both of which have special meaning inside a URL. URL-safe Base64 swaps them for "-" and "_" and usually drops the trailing "=" padding, so the result can go straight into a URL or filename without escaping. This tool's decoder accepts either variant automatically.
A Data URI embeds a file's Base64 data directly inside a "src" or "url()" — like "data:image/png;base64,AAAA..." — so the browser doesn't need a separate request to fetch it. It's useful for small icons or inline assets, but it makes the file about a third larger and isn't cached separately from the page, so it's a poor fit for large images.
Base64 encodes every 3 bytes of binary data as 4 text characters — each character carries 6 bits instead of a full 8. That fixed 4-to-3 ratio is where the roughly 33% size increase comes from, regardless of what the original file contains.
Yes, completely free with no signup. Text, files and images are all converted entirely in your browser — nothing is uploaded or stored.
Handles text, images and arbitrary files client-side — including auto-detecting image data on decode for a live preview and download, not just plain text round-trips.
Was this tool helpful?
Rate it and leave a comment — takes 10 seconds, and genuinely helps decide what to fix or build next.