FormatterHQ

TSV to Base64

Encode tab-separated values as Base64 so the tabs survive copy-paste, JSON fields, chat tools and editors that turn tabs into spaces.

Loading tool…
Ready.

How to use the TSV to Base64

  1. Type or paste into the TSV box, or click Sample. You can also drop a file on a box or use its Open file button.
  2. The Base64 box updates live as you type. It works both ways — edit the Base64 side to convert back, or click ⇄ Swap to exchange the sides.
  3. Adjust Alphabet and Wrap lines at 76 chars (MIME) in the options bar above the editors; the result refreshes immediately.
  4. Use Copy or Download on either box to take the result, or Clear to start again.

TSV to Base64 keeps your tabs intact

Tab characters are fragile. Code editors convert them to spaces, chat apps and ticket systems collapse them, and some form fields strip them entirely — and once a tab becomes spaces, a TSV file silently turns into one column. Converting TSV to Base64 protects the data: every tab (byte 09) and line break is encoded, and decoding restores them exactly.

Example

Input:

id	name	city
1	Ada	London
2	Linus	Helsinki

Output:

aWQJbmFtZQljaXR5CjEJQWRhCUxvbmRvbgoyCUxpbnVzCUhlbHNpbmtp

Notice the recurring CU and J fragments in the output — they come from the tab bytes interleaved with the text.

Where TSV comes from

  • Copying a range of cells from Excel, Google Sheets or LibreOffice puts TSV on the clipboard.
  • Database clients such as mysql in batch mode and many admin tools export tab-separated results.
  • Bioinformatics and analytics tools that prefer TSV because tabs rarely occur inside values.
  • Linux command-line tools where tab-delimited output works well with cut, awk and sort.

Why TSV instead of CSV?

TSV has a simpler escaping story: values rarely contain tabs, so most TSV files need no quoting at all, unlike CSV where commas inside values force quotes. The downside is exactly the fragility of tabs described above — which is what Base64 solves when data must travel through text channels. If you need CSV instead, convert with TSV to CSV.

Encoding also protects values that contain leading or trailing spaces, which many editors trim silently. After decoding, the spaces are exactly where they were.

Checking tabs before and after

On the command line, cat -A data.tsv (GNU) shows tabs as ^I and line ends as $, a quick way to verify that a file really is tab-separated before you encode it. To encode a file in a terminal, base64 < data.tsv does the same job as this tool; add -w 0 on Linux for single-line output.

Encoding details

  • Text is encoded as UTF-8, so non-ASCII values such as names with accents are preserved.
  • You can upload a .tsv or .txt file instead of pasting.
  • URL-safe output avoids + and / if the value will be placed in a URL.

Decode with Base64 to TSV. The encoding runs locally in your browser.

Frequently asked questions

Why do my tabs turn into spaces when I share TSV data?
Many editors and chat tools replace tabs with spaces. Encoding the data as Base64 protects the tabs, and decoding restores them exactly.
What does a tab look like in Base64?
A tab is byte 09. Its Base64 form depends on its position and the neighbouring bytes: a tab that ends a three-byte group always becomes J, and one that starts a group begins with C, so in tab-separated text these letters keep recurring.
Can I paste cells directly from a spreadsheet?
Yes. Copying cells from Excel or Google Sheets produces tab-separated text, which you can paste and encode directly.
Is TSV the same as CSV with tabs?
Essentially, yes, although TSV usually avoids quoting altogether, while CSV has defined rules for quoting values that contain delimiters.
How much larger is the Base64 than the TSV?
About one third larger: every 3 bytes become 4 characters, plus up to two = padding characters at the end. Turning on MIME wrapping adds a line break every 76 characters, which makes it slightly longer again.

Last updated October 3, 2026

Related tools