CSV to Base64 Converter

Encode a table as Base64 for an API field, an attachment or a download link.

CSV
Base64
Runs locally in your browser

About the CSV to Base64 Converter

Attaching a spreadsheet through an API almost always means Base64. Mail services want the attachment content as an encoded string, document stores want it in a JSON body, and a browser download link built from a data URI needs the same thing. Getting the bytes right before encoding is what separates a file that opens cleanly from one that shows mojibake in the first column.

Two switches deal with the usual Excel problems. The byte order mark prepends the three bytes EF BB BF, which is the signal Excel on Windows looks for before it will treat the file as UTF-8 rather than as the local code page. Without it, a name such as Kraków arrives mangled. The line ending selector produces CRLF, which is what RFC 4180 actually specifies and what a few older importers insist on.

Blank lines are removed by default, because a trailing newline at the end of an export often becomes a phantom empty row after import. The status line counts the rows and columns that were encoded so you can confirm the table is the size you expected before the payload disappears into a request body.

The data URI option produces a string you can put straight in an anchor href to offer a download without a server. Decode an existing payload with Base64 to CSV, or convert the table itself with CSV to JSON.

How to use

  1. Paste your rows into the left pane, header row included.
  2. Tick Add a UTF-8 byte order mark when the file is destined for Excel on Windows.
  3. Switch Line endings to CRLF if the receiving importer expects RFC 4180.
  4. Copy the Base64, or choose the data URI shape for a download link.

Common questions

When do I need the byte order mark?
When a person will open the file in Excel on Windows and the data contains accented or non-Latin characters.
Does the BOM affect programs other than Excel?
Some parsers treat it as part of the first header name, so leave it off for machine to machine transfers.
Why remove blank lines?
A trailing newline commonly imports as an empty record. Untick the option if your format uses blank lines deliberately.
Can I use the data URI as a download link?
Yes. Put it in an anchor href with a download attribute and the browser saves it without any server involvement.