Base64 Encode & Decode
Encode text, files, and images to Base64, decode it back, and get a ready-to-use data URI.
Direction
Converted live as you type. Nothing leaves your browser.
How to convert text or a file to Base64 online
Pick a mode
Choose Encode to turn text into Base64, Decode to turn Base64 back into text, or File to turn a file or image into Base64.
Add your input
Type or paste text, or in File mode drop, browse, or paste a file up to 10 MB. Everything runs live with no convert button to press.
Read the result
Text modes show the converted string. File mode shows the raw Base64 and a ready-to-use data URI, plus an inline preview when the file is an image.
Copy what you need
Copy the encoded or decoded text, the Base64 string, or the full data URI with one click.
Why use this tool
Three modes in one tool
Encode text, decode Base64, or convert a file to Base64 without leaving the page. One switch moves between them.
Files and images too
Drop, browse, or paste a file up to 10 MB and get its Base64 back, with an inline preview when the file is an image.
Ready-to-use data URI
File mode also outputs a full data URI in the form data:type;base64,value that you can paste straight into CSS, an img tag, or a fetch call.
URL-safe alphabet on demand
A single toggle produces base64url output: + becomes -, / becomes _, and the = padding is dropped, ready for URLs, filenames, and tokens.
Forgiving decoder
Decoding accepts standard and URL-safe alphabets at the same time, ignores whitespace and line breaks, and restores missing padding automatically.
Local and free
Encoding, decoding, and file conversion all happen instantly in the page. No account, no server, no quota.
About this tool
This tool converts text to Base64 and Base64 back to text entirely in your browser, handling input as UTF-8 so multi-byte characters encode correctly. It runs live: every keystroke re-encodes or re-decodes the input, and switching mode or toggling the URL-safe alphabet updates the result immediately. Decoding is deliberately tolerant, accepting standard and base64url input alike, stripping whitespace, and re-adding missing padding before conversion.
File mode takes any file up to 10 MB by drop, browse, or paste and returns two things: the raw Base64 string and a complete data URI in the form data:type;base64,value that you can paste straight into CSS, an img tag, a background image, or a fetch call. When the file is an image you also get an inline preview, so you can confirm you encoded the right thing before copying. This data URI output is the piece most encoders skip, and it is what turns a small icon or font into something you can inline without a separate request.
Developers reach for Base64 constantly: reading a value out of an HTTP Basic auth header, embedding a small file as a data URI, inspecting an opaque string found in a config file or API response, or preparing binary-safe text for transport. Everything happens in the page itself, so the text and files you paste are never transmitted, which matters when they contain credentials or private assets. Remember that Base64 is an encoding, not encryption, so anything encoded is trivially readable. To inspect the segments of a JSON Web Token with its claims laid out, use the JWT decoder; for percent-encoding text into query strings there is the URL encoder.
Frequently asked questions
- What is Base64 encoding?
- Base64 represents binary or text data using only 64 printable ASCII characters. It is widely used to embed data in URLs, JSON, data URIs, email, and HTTP headers where raw bytes are not safe to transmit. It is an encoding, not encryption, so it provides no security on its own.
- How do I encode, decode, or convert a file?
- Pick Encode, Decode, or File. Encode turns text into Base64, Decode takes Base64 back to text, and File turns a dropped or pasted file into Base64. Everything updates live, and each result has its own copy button.
- Can I convert a file or image to Base64?
- Yes. Switch to File mode, then drop, browse, or paste a file up to 10 MB. The tool shows both the raw Base64 string and a ready-to-use data URI, and for images it adds an inline preview. The 10 MB cap keeps very large files from freezing the tab.
- What does the URL-safe option do?
- URL-safe Base64 swaps the "+" and "/" characters for "-" and "_" and drops the trailing "=" padding, so the string can be dropped straight into a URL or filename without escaping. When decoding, the tool accepts both standard and URL-safe input automatically.
- Does it support emoji and non-English text?
- Yes. Text is encoded as UTF-8 before being converted to Base64, so accents, emoji, and other multi-byte characters round-trip correctly in both directions.
- Is my text or file uploaded anywhere?
- No. Encoding, decoding, and file conversion all run entirely in your browser. Your text and files never leave your device, are never sent to a server, and are not stored or logged.
Related tools
Unicode Escape & Unescape
Convert text to and from \uXXXX escape sequences and HTML entities.
Number Base Converter
Convert a number between binary, octal, decimal, and hexadecimal, all four shown at once.
API Key Generator
Generate cryptographically random API keys and tokens in hex, base62, or base64url, with control over length, an optional prefix, and bulk output.
ASCII Table Reference
The full ASCII character set with decimal, hex, octal, binary, and HTML codes. Search by code, character, or name.
Atbash Cipher
Mirror the alphabet so A swaps with Z, B with Y, and so on. Atbash is its own inverse, so one field both encodes and decodes as you type.
Base32 Encoder and Decoder
Encode text to standard Base32 and decode Base32 back to text, following RFC 4648.