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 HelsinkiOutput:
aWQJbmFtZQljaXR5CjEJQWRhCUxvbmRvbgoyCUxpbnVzCUhlbHNpbmtpNotice 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
mysqlin 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.