CSV to Base64

Encode CSV rows to Base64 and decode them back. Working with JSON instead? Try JSON to Base64.

0 characters

Example

The CSV row name,age Ada,36 encodes to bmFtZSxhZ2UKQWRhLDM2. In code you would do:

JavaScript
const csv = "name,age\nAda,36";
const b64 = btoa(unescape(encodeURIComponent(csv))); // "bmFtZSxhZ2UKQWRhLDM2"
const back = decodeURIComponent(escape(atob(b64)));

CSV to Base64 — FAQ

How do I Base64 encode a CSV file?+

Paste your CSV rows above and switch to Encode, or use the Upload button to load a .csv file. The result is a Base64 string safe to embed in JSON payloads or send over APIs.

Why Base64 encode CSV data?+

CSV files can contain commas, quotes and newlines that break JSON or form fields. Base64 wraps the whole file as one plain-text-safe string, commonly used to attach CSV exports to API requests or emails.

Does Base64 encoding change my CSV data?+

No. Decoding returns the exact original bytes, so commas, line endings and quoting are preserved exactly as they were.

Can I decode a large CSV export this way?+

Yes, but very large files are better handled with the file-based conversion in your programming language (see the code example below) rather than pasting text by hand.