Where tab-separated data comes from
You probably handle TSV more often than you think. When you copy a range of cells from Excel, Google Sheets or LibreOffice, the clipboard holds tab-separated text. MySQL’s mysql -B batch mode, psql with -A -F $'\t', BigQuery and Redshift exports, Hive tables, genomics formats such as BED and VCF, and many analytics downloads use tabs too. Tabs are popular as a separator precisely because they almost never appear inside real values, so most TSV needs no quoting at all.
The catch is that tabs render at unpredictable widths. A column of short SKUs next to a column of long product names turns into a zig-zag in any editor or chat window. This page fixes the display problem and checks the structure at the same time.
How it works
Paste the data (or drop a .tsv or .tab file) and press Ctrl/Cmd+Enter. Each value is padded with spaces up to the width of its column, and the tab stays as the separator, so the aligned text is still valid TSV for any reader that trims values. Ctrl/Cmd+Shift+M produces the opposite: one tab between values and no padding, ready to paste back into a spreadsheet. Copy with Ctrl/Cmd+Shift+C; Ctrl/Cmd+K opens the palette with the Table view and conversions.
Rows are compared with the first row and any mismatch is listed with its line number. Quoted fields are understood when they occur, which matters for spreadsheet copies of cells containing line breaks: Excel wraps those cells in double quotes. Unneeded quotes are dropped in the output, so "Mouse, wireless" becomes Mouse, wireless.
Since the clipboard often carries whole sheets of customer or payroll data, it is worth knowing that the text is parsed by JavaScript running in this page, not by a server.
The two options
TSV has fewer knobs than CSV because the delimiter is fixed.
- First row is a header decides whether the first line names the columns. With it on, the Table view and the TSV to JSON conversion use those names as keys; with it off, columns are numbered and the first line is treated as data. The aligned text is the same either way.
- Trim spaces around values strips leading and trailing spaces from each value as it is read. Keep it on when you re-read aligned output, otherwise the padding becomes part of the values. If you switch it off during alignment, an info note explains the trade-off; values whose spaces are significant, like fixed-width codes, are a reason to minify instead.
Things that trip people up
- Spaces instead of tabs. Some editors convert tabs to spaces on save, and chat apps often do the same when you paste. The result looks aligned but has a single column. If the Table view shows one wide column, that is the cause, and the reliable fix is to copy from the source again. Data that really is comma- or semicolon-separated belongs in the CSV formatter.
- Backslash escapes are not TSV quoting. PostgreSQL’s
COPY ... TOtext format writes a tab inside a value as\tand a newline as\n. Those escapes are kept as literal characters here, which is correct, but they will not be decoded. - Trailing tabs. A row ending in a tab has an empty last field. Spreadsheets add these when the copied range includes empty cells, and they can trigger “Row N has 5 fields, expected 4” warnings.
- Windows paths. Backslashes in values such as
C:\exports\q3are plain characters in TSV and pass through unchanged.
Examples
Quarterly revenue copied from Google Sheets
Region names of different lengths are padded so that every column starts at the same position.
region quarter revenue_usd growth sales_lead
Asia Pacific Q3 2026 1284500 0.12 Aisha Tan
EMEA Q3 2026 976320 0.04 Lukas Schmidt
North America Q3 2026 1530875 -0.02 Maya Patel
Latin America Q3 2026 402110 0.19 Diego Ruiz
region quarter revenue_usd growth sales_lead
Asia Pacific Q3 2026 1284500 0.12 Aisha Tan
EMEA Q3 2026 976320 0.04 Lukas Schmidt
North America Q3 2026 1530875 -0.02 Maya Patel
Latin America Q3 2026 402110 0.19 Diego Ruiz
mysql -B output with a multi-line note
The quoted note that spans two lines is kept as one field and the empty note on row 3 stays empty.
order_id customer status note
1001 Aisha Tan paid "Leave at reception
call on arrival"
1002 Ben Okafor shipped
1003 Chloé Martin refunded Damaged in transit
order_id customer status note
1001 Aisha Tan paid "Leave at reception
call on arrival"
1002 Ben Okafor shipped
1003 Chloé Martin refunded Damaged in transit
Inventory export compacted for pasting back
Padding spaces are trimmed away so each line has exactly one tab between values.
sku warehouse on_hand reorder_at
KB-104 SIN-01 42 20
MS-220 SIN-01 7 25
HB-007 LOS-02 130 40
sku warehouse on_hand reorder_at
KB-104 SIN-01 42 20
MS-220 SIN-01 7 25
HB-007 LOS-02 130 40Common errors and how to fix them
| Error | Cause | Fix |
|---|---|---|
Row 3 has 5 fields, expected 4Explained | The row has an extra tab, often a trailing one from an empty spreadsheet cell, or a value that itself contains a tab. | Remove the stray tab, or re-copy the range without the empty column. |
The Table view shows a single column | There are no tab characters in the text; an editor or chat app replaced them with spaces. | Copy the data again directly from the spreadsheet or terminal. If it was never tab-separated, use the CSV formatter, which detects commas, semicolons and pipes. |
A quoted field is never closedExplained | A value begins with a double quote that has no partner, for example a product name like “12” monitor. | Close the quote, or double the quote character inside the value (“12"” monitor") so it reads as text. |
Accented names appear as é or �Explained | The file was saved in one encoding and read in another, typically a UTF-8 export opened as Windows-1252. | Drop the original file onto the page instead of pasting it; the decoder picks UTF-8, UTF-16 or Windows-1252 from the bytes. |
Frequently asked questions
What is the difference between TSV and CSV?
Only the separator: TSV uses a tab, CSV a comma (or a semicolon in some locales). Because tabs rarely occur inside values, TSV usually needs no quoting, which makes it easier to produce and parse by hand.
How do I paste TSV into Excel or Google Sheets?
Minify the data so each line has single tabs, copy it, and paste into a cell. Both programs split tab-separated clipboard text into columns automatically.
Can I convert TSV to CSV or JSON?
Yes. Use TSV to CSV to change the separator with correct quoting, or TSV to JSON to get an array of objects keyed by the header row.
Why does my TSV look misaligned in a text editor?
Editors expand a tab to the next tab stop, usually every 4 or 8 characters, so values longer than the stop push the following columns out of line. Aligning pads values with spaces so the layout no longer depends on tab width.