Home Tools Blog About

Convert CSV to Base64

In short

online CSV to Base64 encoder. Standard and URL-safe, MIME line-wrap, UTF-8 safe. Client-side, instant, secure - no uploads.

  • Runs in your browser
  • Nothing uploaded
  • Free, no sign-up

Encode a CSV (or any UTF-8 text) to Base64. Standard RFC 4648 or URL-safe alphabet, optional MIME line-wrap, optional BOM. Runs entirely in your browser.

🛡
100% PrivateNo server uploads, ever
InstantRuns in your browser
💧
No WatermarksClean output, always
🆓
Free ForeverNo accounts, no limits

How to Use Convert CSV to Base64

  1. Paste your CSV into the input field. Base64 is a byte-level encoder, so any text works - CSVs, JSON, plaintext, even binary pasted as text.
  2. Pick a variant. Standard (RFC 4648 §4) uses the classic alphabet with + and /. URL-safe (§5) replaces those with - and _, so the result drops straight into a URL or filename without escaping.
  3. Choose a line wrap. Leave it at None for a single-line token (what most APIs want). Set 64 for PEM-style, or 76 for MIME/email body compatibility (RFC 2045).
  4. Optional toggles. Strip padding removes trailing = characters (common with JWT/URL-safe). Prepend UTF-8 BOM adds EF BB BF to the input bytes before encoding - handy when the consumer expects a BOM for Excel compatibility.
  5. Press "Encode to Base64" (or Ctrl+Enter). The tool also runs live as you type with a 200 ms debounce. Stats show exact byte-to-char ratio (always ~1.33× for standard Base64).
  6. Copy or download. Copy puts the Base64 on your clipboard; Download saves a csv-base64-*.txt file. To go the other way, feed the result into our CSV-from-Base64 decoder.

Frequently Asked Questions

Why does Base64 make my CSV 33% larger?

Base64 packs 3 input bytes into 4 output characters (each character carries 6 bits). That’s a fixed 4/3 expansion – about 33%. Plus up to 2 characters of = padding at the end to round out to a multiple of 4. The overhead is the price of making arbitrary bytes safe for text-only channels.

Does Base64 preserve my CSV’s newlines and commas?

Yes. Base64 operates on bytes, not structure. Newlines (0x0A), carriage returns, commas, quotes, tabs – every byte goes in, every byte comes back out on decode. A round-trip is guaranteed lossless, which is exactly why Base64 is used to ship CSV through channels that would otherwise mangle line endings or strip special characters.

When should I use URL-safe Base64 instead of standard?

Use URL-safe whenever the result ends up in a URL path, query string, filename, or JSON Web Token. Standard Base64’s + and / get percent-encoded in URLs (to %2B and %2F), which doubles the effective overhead. URL-safe swaps them for - and _ so the string drops in cleanly.

What does the MIME 76-char wrap do?

RFC 2045 (MIME) requires Base64 bodies in email to break every 76 characters with a CRLF so legacy mail servers don’t choke on long lines. This tool uses LF to stay readable on screen; add r yourself if you’re targeting a strict MIME implementation. Use 64 for PEM blocks (certificates, private keys).

Does the tool handle UTF-8 characters like 日本 or 😀 correctly?

Yes. Input is encoded via TextEncoder to UTF-8 bytes before Base64 runs. So 日本 (6 UTF-8 bytes) encodes to 8 Base64 characters, and a 4-byte emoji encodes to roughly 6 characters plus padding. The deprecated unescape()/btoa() trick is avoided entirely.

Why would I prepend a UTF-8 BOM?

Mostly for Excel. When you decode the Base64 and save the result as a .csv, Excel on Windows treats files without a BOM as ANSI (cp1252), which mangles non-ASCII characters. A leading EF BB BF tells Excel “this is UTF-8” and fixes the encoding detection.

Can I embed the output directly in a data: URL?

Yes. Prefix with data:text/csv;base64, and you have a self-contained URL that downloads your CSV when clicked. Prefer URL-safe Base64 or use standard and expect the browser to handle +//. For very large CSVs browsers cap data URL length at a few MB.

What are the padding = characters for?

Base64 outputs 4 chars per 3 input bytes. If the input byte length isn’t a multiple of 3, Base64 appends one or two = to pad to 4. Length of = padding = (3 - inputBytes % 3) % 3. Strip-padding toggle removes them – the decoder can reconstruct from length alone.

How do I go the other way, Base64 back to CSV?

Use our Base64-to-CSV decoder (or any Base64 decoder). Since encoding is pure byte work, the decoded output will be byte-identical to your original CSV, including newlines, quoting, and BOM if you prepended one. Nothing is lost.

Is the tool free, offline, and private?

Yes to all three. The encoder runs entirely in your browser with TextEncoder + btoa. Your CSV is never uploaded, never logged, never stored. Load the page once, disconnect from the internet, and it keeps working indefinitely.

Keep going

Related Tools

All Csv tools →
Share

Embed this tool

Add this free tool to your website. Copy and paste the code: