SmartQueryTools

Convert TSV to YAML Online

Convert TSV files to YAML directly in your browser. Download clean, human-readable YAML — no upload required.

About converting TSV to YAML

TSV to YAML is mostly used to turn a table into configuration or metadata. Snakemake workflows commonly keep a samples.tsv next to a config.yaml, and moving part of a sample table into the config is a routine step. Outside science, a tab-separated list copied from a spreadsheet can become a YAML list for Ansible, Kubernetes values or a static site.

Each TSV row becomes one item in a YAML list, with the header names as keys. The output uses two-space indentation, never tabs, because YAML forbids tab characters for indentation. Values are never wrapped, so each field sits on one line. Keys keep the exact header text, so a header such as Sample ID becomes a key with a space in it, which YAML allows but some tools make awkward to reference.

Watch how IDs are typed. A sample column holding 1, 2 and 3 is read as integers and written as bare YAML numbers, which a tool expecting string IDs may reject. IDs with leading zeros, such as 001, are safer: the column is read as text, and 001 is quoted so it loads back as a string. Headerless files produce keys like column0 and column1, which make a poor config, so add a header line before converting.

Worked example

A small sample file, converted with the default settings.

Input (TSV)

symbol	chrom	description	tpm	detected
TP53	chr17	tumor protein p53	24.7	true
BRCA1	chr17	BRCA1 DNA repair associated	8.13	true
NT5C	chr17	5', 3'-nucleotidase, cytosolic	3.4	true
SREBF2	chr22	sterol regulatory element binding transcription factor 2		false

Output (YAML)

- symbol: TP53
  chrom: chr17
  description: tumor protein p53
  tpm: 24.7
  detected: true
- symbol: BRCA1
  chrom: chr17
  description: BRCA1 DNA repair associated
  tpm: 8.13
  detected: true
- symbol: NT5C
  chrom: chr17
  description: 5', 3'-nucleotidase, cytosolic
  tpm: 3.4
  detected: true
- symbol: SREBF2
  chrom: chr22
  description: sterol regulatory element binding transcription factor 2
  tpm: null
  detected: false

What changes when you convert TSV to YAML

  • Each TSV line becomes a list item starting with "- ", and each column a key under it.
  • tpm and detected are written bare (tpm: 24.7, detected: true), so YAML loaders read them as a number and a boolean.
  • SREBF2 gets tpm: null. The key is still present.
  • NT5C's description is written unquoted on one line. Its commas and apostrophes are safe in a plain YAML scalar.
  • Values such as NO, yes, on or 00123 would be quoted so they stay strings.

Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.

Frequently Asked Questions

Can I use the output as a Snakemake config?

You can load it with yaml.safe_load, but it is a list of rows, not a mapping. Snakemake configs are usually mappings, so put the list under a key such as samples: and indent it by two spaces.

Why are some values in single quotes?

Without quotes they would be read as a different type. YAML 1.1 readers treat yes, no, on and off as booleans, and most loaders turn an unquoted 2026-03-02 into a date. The quotes are YAML syntax and disappear when the file is loaded.

What happens to a tab inside a value?

It is kept, and the value is written as a double-quoted string with a \t escape, since a raw tab could be mistaken for indentation.

Related Tools