Base64 Encoder
Convert text or a file into Base64 — for embedding images in CSS or HTML, sending binary data in JSON, or building HTTP Basic authentication headers. Supports the URL-safe variant.
Runs in your browser
How to use
- Choose text or file.
- Type your text or drop a file.
- Enable URL-safe mode or data: URL output if needed.
- Copy the encoded string.
How it works
Text is first encoded as UTF-8 bytes, so accented letters and emoji work (unlike the plain btoa function, which fails on them). Every 3 bytes become 4 characters from the 64-character alphabet defined in RFC 4648, which makes Base64 about 33% larger than the original.
Base64URL replaces + and / with - and _ and removes = padding, so the result can be used in URLs and JWTs without further escaping.
Examples
- Text
- “Hello, world!” → SGVsbG8sIHdvcmxkIQ==
- Small image in CSS
- Drop an icon and enable data: URL to get background-image: url(data:image/png;base64,…).
Common uses
- Embedding small images in HTML, CSS or emails
- Sending binary data in JSON APIs
- Creating Basic Auth headers
Privacy & security
This tool runs entirely in your browser. Your files and text are never uploaded to our servers — processing happens on your device and results are created locally. How each tool handles files
Frequently asked questions
Is Base64 encryption?
No. Base64 is an encoding anyone can reverse. Never use it to protect passwords or secrets.
Should I inline large images as Base64?
Generally no. Base64 adds 33% and prevents caching. Inline only very small icons.
Last updated: