IT
OmnvertImage • Document • Network

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.

Your data stays in your browser. No uploads.
Input type
Detected: Text
Input
Chars: 0 • Bytes: 0
Output
Chars: 0 • Bytes: 0

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

Encode credentials safely for transport (not encryption!)

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.

Convert images/files to Base64 for HTML/CSS/Data URI

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.

Decode Base64 from APIs

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.

URL‑safe Base64 for JWT and web tokens

JWT segments are URL‑safe Base64 without padding. Toggle URL‑safe output and padding control when you’re generating or debugging token-like strings.

Fix padding & whitespace issues

Base64 copied from emails, logs, or terminals often includes line breaks. Use “Remove whitespace”, “Fix URL‑safe”, and “Add padding” to normalize inputs.

Verify size inflation (~33%)

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

Invalid characters

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.

Missing or wrong padding

Some systems omit '=' padding. If strict padding is enabled, add the missing padding or turn strict mode off.

URL‑safe vs standard mismatch

If the input uses '-' and '_' but your decoder expects '+' and '/', use the “Fix URL‑safe” helper or enable URL‑safe handling.

Data URI vs raw Base64

Data URIs start with data:...;base64,. The tool auto-detects them and extracts the Base64 part so you can decode correctly.

Invalid UTF‑8 on decode

If the Base64 represents a binary file, decoding to text will fail. Switch to File mode and download the bytes as a file.

Large input feels slow

For big strings and files, enable whitespace handling only when necessary, and let the Web Worker finish—your browser stays responsive during processing.

Examples

Text (UTF‑8)
Hello, Omnvert! 👋🌍\nBase64 is not encryption.
URL‑safe Base64
SGVsbG8sIE9tbnZlcnQhIPCfkYvwn4yNCkJhc2U2NCBpcyBub3QgZW5jcnlwdGlvbi4
Data URI
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.

base64 encode file onlinebase64 decode file onlinebase64 encode text onlinebase64 decode text onlinedecode base64 with newlinesbase64 with whitespaceremove spaces from base64fix invalid base64 paddingbase64 missing padding fixurl safe base64 encoderbase64 urlsafe to standardjwt base64 url safebase64 without paddingconvert image to base64convert png to base64 data uriconvert jpg to base64 data uriconvert svg to base64base64 to png downloadbase64 to pdf downloaddecode data uri to filedata uri to file converterbase64 to blob downloadbase64 to binary filebase64 validatorcheck if string is base64base64 decoder utf8 errorbase64 encode utf8base64 decode utf8base64 size increase 33 percentbase64 large file 50mb

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.

Related tools