Base64 Encode / Decode
Encode text to Base64 or decode it back, with full support for accents and emoji. You can also turn any file into Base64 or a data URI.
File to Base64
Convert an image or any file into Base64 or a data URI for HTML and CSS. Files stay on your device.
Key facts
- Privacy
- Runs in your browser: your files and text are never uploaded
- Last updated
How to encode and decode Base64
Choose Encode, type or paste your text, and the Base64 appears instantly. Switch to Decode to turn Base64 back into text; the result moves across automatically so you can check a round trip. Text is handled as UTF-8, so accents, Chinese characters and emoji survive intact.
To embed an image in HTML or CSS, use File to Base64 and copy the data URI, for example background-image: url(data:image/png;base64,…). Keep embedded files small: Base64 makes them about 33% larger.
Frequently asked questions
What is Base64?
Base64 represents binary data using 64 safe text characters (A–Z, a–z, 0–9, + and /). It is used to put images in CSS or HTML, send attachments in email, and pass data in JSON or URLs.
What is URL-safe Base64?
It replaces + with - and / with _ and drops the = padding, so the result can go in a URL or file name without escaping. JWT tokens use this form.
Is Base64 encryption?
No. Anyone can decode Base64. It only changes how data is written, so never use it to hide passwords or secrets.
Why is Base64 bigger than the original?
Base64 turns every 3 bytes into 4 characters, so encoded data is about 33% larger, plus up to two = padding characters at the end.
How do I put a Base64 image in HTML or CSS?
Use a data URI: <img src="data:image/png;base64,..."> in HTML, or url("data:image/png;base64,...") in CSS. It saves a request for small icons, but large images are better as normal files.
Sources
The rules and figures this tool uses come from:
Related tools
- JSON FormatterPretty-print, validate and minify JSON
- URL Encode / DecodePercent-encode text and inspect URLs
- Hash GeneratorMD5, SHA-1, SHA-256 and SHA-512 for text and files
- JWT DecoderInspect header, payload, expiry and signature
- Regex TesterTest patterns with live match highlights
- Unix Timestamp ConverterEpoch time to dates and back
- Binary ConverterBinary, decimal, hex and octal, two’s complement and text to binary
- UUID Generatorv4 and v7 UUIDs in bulk