DevSwitch.net
Back to Tools
⇄

TSV to YAML Converter

Convert TSV (Tab-Separated Values) to YAML format

File Converters

Tip: The first row will be used as keys in the YAML output. Each row becomes an array item.

Runs in your browser

Input TSV

Convert TSV to YAML in your browser

Paste tab-separated text, open a .tsv file or drop it on the input window, and the YAML appears as you type. Each line after the header becomes one list item, and the header names are its keys. Copy the result or download it as a .yaml file.

This is a quick way to turn a table kept in a spreadsheet, such as a list of products, users or feature flags, into YAML for a config file, a fixture or a static site's data folder.

TSV to YAML example

Real output for a small product list. The SKUs and the price 4.50 are quoted, the quantities are not:

products.tsv
sku	product	qty	price
00412	Desk lamp, brass	2	39.9
00977	USB-C cable	10	4.50
products.yaml
- sku: '00412'
  product: Desk lamp, brass
  qty: 2
  price: 39.9
- sku: '00977'
  product: USB-C cable
  qty: 10
  price: '4.50'

Numbers, text and quotes in the YAML

A cell becomes a YAML number only when nothing is lost. A cell that stays text is quoted wherever YAML would misread it:

  • TSV

    2, 39.9

    YAML

    Are written as plain numbers.

  • TSV

    00412, 4.50

    YAML

    Become '00412' and '4.50'. Unquoted, a YAML reader would load them as numbers and drop the zeros.

  • TSV

    TRUE, on

    YAML

    Become 'TRUE' and 'on', so a YAML reader does not load them as booleans.

  • TSV

    Desk lamp, brass

    YAML

    Stays unquoted: a comma means nothing special in a YAML value.

  • TSV

    An empty cell

    YAML

    Becomes '', an empty string, rather than null.

From a spreadsheet to a YAML list

  1. Copy the cells

    Select the range in Excel or Google Sheets with the header row on top and copy it. The clipboard now holds TSV.

  2. Paste them here

    Paste into the input window. The YAML is written as you type, and an error, such as an unclosed quote, shows in the output window.

  3. Copy or download

    Copy the YAML into your file, or click Download for a .yaml file. Header names are trimmed, and empty or repeated ones are numbered by position.

Need the TSV back?

The YAML to TSV converter turns a YAML list back into tab-separated rows, ready to paste into a sheet.

TSV to YAML questions

Without quotes YAML reads it as a number and the leading zeros are lost. The quotes keep it as the text you had in the sheet.

Yes. Spreadsheets copy such a cell in double quotes, and it is read as one value. In the YAML it becomes a |- block with one line of text per line.

No. Each value stays on one line however long it is, so a URL or a description is never split.

Yes. Click Open file and pick a .tsv, .tab or .txt file, or drop it on the input window.

No. Converting runs in your browser, and an opened file is read there too.