Base64 Encoder
Runs locally in your browser. Nothing leaves your device.Encode text or local files to Base64, Base64URL, MIME Base64, or data URLs directly in the browser.
Base64 settings
Input
Output
Paste text or choose a file to see the preview.
Paste text or choose a file to see the preview.
How it works
- 1
Enter text or select a file
Switch between the text and file tabs and provide the source for encoding.
- 2
Choose the format and options
Choose standard, Base64URL, or MIME, plus padding, line wrapping, and optional data URL settings.
- 3
Copy or download the Base64
Copy the complete Base64 output or download it as a text file.
Good to know
The Base64 encoder encodes text or files into Base64 directly in your browser, with three formats: standard (+ and /), Base64URL (- and _), and MIME (wrapped at 76 characters). The output can also be generated as a data URL with a configurable media type.
Line wrapping, padding, text line endings, and an optional byte order mark can each be controlled individually. Important: Base64 typically makes data about a third larger and is meant for transport, not compression or secrecy.
Typical use cases
Embed an image as a data URL directly in CSS or HTML
Choose an image file and the matching media type to generate a data: URL that can be inserted directly into stylesheets or markup.
Make binary data transportable for JSON or text protocols
Convert a file to Base64 so it can be safely embedded as a string in JSON, XML, or other text-based formats.
Tips for better results
Use Base64URL for URLs and filenames
Choose the Base64URL format when the result ends up in a URL or filename — it avoids the characters + and /, which can cause problems there.
Don't mistake Base64 for encryption
Base64 is reversible without a key and provides no confidentiality — use it only for transport or embedding, not to protect sensitive data.
Features
Three Base64 formats
Standard, Base64URL, or MIME with automatic line wrapping at 76 characters.
Data URL generation
Generate a complete data: URL with the matching media type directly from text or a file.
Local processing
Text and files never leave your device; encoding runs entirely in the browser.
Frequently asked questions
What's the difference between standard and Base64URL?
Standard uses + and /, Base64URL replaces these with - and _ so the result can be safely used in URLs and filenames.
Is Base64 encryption?
No. Base64 is reversible without a key and serves transport, not secrecy.
More tools
Looking for another tool?
Every tool runs locally in your browser – no sign-up, no upload, and it works offline.