Base64 converter (text & file)
Encode/decode Base64 for text and files. URL‑safe mode, padding control, Data URI support, and large-file processing — fully in your browser.
About this Base64 tool
Base64 is a simple, deterministic way to represent bytes as readable text. It’s commonly used when a system expects text-only payloads—such as JSON APIs, email bodies, environment variables, or configuration files—but you still need to move binary data like images or PDFs. This page gives you a fast Base64 encoder/decoder for both text and files, with clear validation and helpful fixes when inputs come from messy sources.
You can paste Base64 with spaces or newlines, toggle URL‑safe output for JWT and token workflows, control “=” padding, and generate or parse Data URIs. Everything runs client‑side for privacy: your input never leaves your browser. For large inputs and files, the converter uses chunking and a Web Worker to keep the UI responsive.
Use cases
Base64 is often used to transport credentials in formats like HTTP Basic Auth, but it’s not encryption. Use it to encode bytes for transfer, and rely on TLS + proper secrets handling for security.
Need to embed a small icon into HTML/CSS? Convert a PNG/JPG/SVG to Base64 and optionally output a ready-to-use data:mime/type;base64,... Data URI.
Many APIs return files as Base64. Paste the response, fix whitespace/newlines if needed, and download the decoded file with the correct name and extension.
JWT segments are URL‑safe Base64 without padding. Toggle URL‑safe output and padding control when you’re generating or debugging token-like strings.
Base64 copied from emails, logs, or terminals often includes line breaks. Use “Remove whitespace”, “Fix URL‑safe”, and “Add padding” to normalize inputs.
Base64 increases size by roughly 33%. Use the byte/char counters to estimate payload size before embedding in JSON, query strings, or Data URIs.
Common problems & fixes
If you see an invalid character error, the string likely contains non‑Base64 characters (quotes, commas, or copied markup). Trim the input and remove whitespace.
Some systems omit '=' padding. If strict padding is enabled, add the missing padding or turn strict mode off.
If the input uses '-' and '_' but your decoder expects '+' and '/', use the “Fix URL‑safe” helper or enable URL‑safe handling.
Data URIs start with data:...;base64,. The tool auto-detects them and extracts the Base64 part so you can decode correctly.
If the Base64 represents a binary file, decoding to text will fail. Switch to File mode and download the bytes as a file.
For big strings and files, enable whitespace handling only when necessary, and let the Web Worker finish—your browser stays responsive during processing.
Examples
Hello, Omnvert! 👋🌍\nBase64 is not encryption.
SGVsbG8sIE9tbnZlcnQhIPCfkYvwn4yNCkJhc2U2NCBpcyBub3QgZW5jcnlwdGlvbi4
data:text/plain;base64,SGVsbG8sIE9tbnZlcnQhIPCfkYvwn4yNCkJhc2U2NCBpcyBub3QgZW5jcnlwdGlvbi4=
Search intents we cover
These are common queries and scenarios people run into when working with Base64 across APIs, files, and browsers.
FAQ
Is Base64 encryption?
No. Base64 is an encoding used to represent bytes as ASCII text. It does not hide or protect the content.
Why does Base64 get bigger?
Base64 expands data by about 33% (4 characters for every 3 bytes), plus optional Data URI prefixes.
Can I decode Base64 that contains newlines or spaces?
Yes. Enable the “Allow spaces/newlines” option, or use the “Remove whitespace” helper.
What is URL‑safe Base64?
URL‑safe Base64 replaces “+” and “/” with “-” and “_” so the string works better in URLs, JWTs, and web tokens.
What does padding '=' mean?
Padding makes Base64 length a multiple of 4. Some systems require it; others omit it (common for URL‑safe tokens).
I get “invalid padding” — how do I fix it?
Try removing whitespace, converting URL‑safe characters back to standard, or adding missing '=' padding.
Why does Base64 decode to “invalid UTF‑8”?
The Base64 content may be a binary file (image/pdf/zip), not text. Use File mode to decode and download it as a file.
Can I convert a file to a Data URI?
Yes. In File → Base64 mode, enable “Output as Data URI” to get a string like data:mime/type;base64,...
Do you upload my text or file?
No. This tool runs fully in your browser; nothing is uploaded.
Can it handle large files (50MB+)?
Yes. Large inputs are processed in a Web Worker with chunking to keep the UI responsive.