Convert TSV to YAML
Max file size 100mb.
TSV vs YAML Format Comparison
| Aspect | TSV (Source Format) | YAML (Target Format) |
|---|---|---|
| Format Overview |
TSV
Tab-Separated Values
Plain text format for storing tabular data where columns are separated by tab characters. Clipboard-native format used when copying from spreadsheets, a bioinformatics standard, and free from quoting issues that plague CSV files. Simpler and more reliable than CSV for data exchange. Tabular Data Clipboard-Native |
YAML
YAML Ain't Markup Language
A human-friendly data serialization language designed for configuration files, data exchange, and complex data structures. YAML uses indentation-based syntax that is easy to read and write. It is the standard configuration format for Docker Compose, Kubernetes, Ansible, GitHub Actions, and many DevOps tools. Configuration DevOps Standard |
| Technical Specifications |
Structure: Rows and columns in plain text
Delimiter: Tab character (U+0009) Encoding: UTF-8 or ASCII Headers: Optional first row as column names Extensions: .tsv, .tab |
Structure: Indentation-based key-value pairs
Data Types: String, Integer, Float, Boolean, Null, Date, List, Map Encoding: UTF-8 Standard: YAML 1.2 (2009) Extensions: .yaml, .yml |
| Syntax Examples |
TSV uses tab-separated values: Name Age City Alice 30 New York Bob 25 London Charlie 35 Tokyo |
YAML uses indentation-based syntax: - Name: Alice Age: 30 City: New York - Name: Bob Age: 25 City: London - Name: Charlie Age: 35 City: Tokyo |
| Content Support |
|
|
| Advantages |
|
|
| Disadvantages |
|
|
| Common Uses |
|
|
| Best For |
|
|
| Version History |
Introduced: 1960s (early computing)
Standard: IANA text/tab-separated-values Status: Widely used, stable MIME Type: text/tab-separated-values |
Introduced: 2001 (Clark Evans, Ingy dot Net, Oren Ben-Kiki)
Current Version: YAML 1.2 (2009) Status: Widely adopted, stable MIME Type: application/x-yaml, text/yaml |
| Software Support |
Microsoft Excel: Full support
Google Sheets: Full support LibreOffice Calc: Full support Other: Python, R, pandas, all databases, BLAST |
Python: PyYAML, ruamel.yaml
JavaScript: js-yaml Ruby: Psych (stdlib) Other: Go, Java (SnakeYAML), Rust, all major languages |
Why Convert TSV to YAML?
Converting TSV data to YAML format transforms flat tab-separated tabular data into a human-readable, structured data serialization format ideal for configuration files and DevOps workflows. While TSV excels at storing raw data from spreadsheets and bioinformatics tools, YAML provides the clean, indentation-based syntax that is standard across Docker, Kubernetes, Ansible, and modern cloud infrastructure.
TSV's clipboard-native nature makes it the easiest way to export data from any spreadsheet. Copy cells in Excel or Google Sheets, paste into a text file, and you have clean TSV data. Unlike CSV, there are no quoting issues or delimiter ambiguity since tab characters virtually never appear in actual data. Our converter takes this clean input and produces properly indented YAML with typed values, where each row becomes a list item with named key-value pairs.
This conversion is particularly valuable for DevOps engineers who maintain configuration data in spreadsheets and need to deploy it as YAML. For example, you might track server configurations, environment variables, or deployment parameters in Excel, then convert them to YAML for use in Docker Compose, Kubernetes manifests, or Ansible playbooks. The converter automatically detects numeric values, booleans, and null values to produce correctly typed YAML output.
TSV to YAML conversion bridges the gap between business-friendly spreadsheets and developer-friendly configuration formats. The converter produces clean, well-indented YAML that follows the 1.2 specification and is compatible with all major YAML parsers including PyYAML, js-yaml, SnakeYAML, and ruamel.yaml.
Key Benefits of Converting TSV to YAML:
- Human Readable: YAML output with clean indentation is easy to read and edit manually
- Clipboard-Native Input: TSV is what you get when copying from Excel or Google Sheets
- No Quoting Hassles: TSV avoids the delimiter conflicts that plague CSV files
- Typed Values: Numbers, booleans, and null values are properly typed in YAML output
- DevOps Ready: Output works with Docker Compose, Kubernetes, Ansible, and GitHub Actions
- Comment Friendly: You can add comments to the generated YAML for documentation
- Data Integrity: All cell values are preserved with appropriate type conversion
Practical Examples
Example 1: Container Service Configuration
Input TSV file (services.tsv):
service image port replicas healthcheck nginx nginx:1.25 80 3 true api myapp/api:latest 3000 2 true redis redis:7-alpine 6379 1 false
Output YAML file (services.yaml):
- service: nginx image: "nginx:1.25" port: 80 replicas: 3 healthcheck: true - service: api image: "myapp/api:latest" port: 3000 replicas: 2 healthcheck: true - service: redis image: "redis:7-alpine" port: 6379 replicas: 1 healthcheck: false
Example 2: Environment Variables for Deployment
Input TSV file (env_config.tsv):
name value secret environment DATABASE_HOST db.example.com false production API_KEY sk-abc123xyz true production LOG_LEVEL debug false staging
Output YAML file (env_config.yaml):
- name: DATABASE_HOST value: db.example.com secret: false environment: production - name: API_KEY value: sk-abc123xyz secret: true environment: production - name: LOG_LEVEL value: debug secret: false environment: staging
Example 3: Test Matrix Configuration
Input TSV file (test_matrix.tsv):
os python_version database parallel ubuntu-22.04 3.11 postgres true ubuntu-22.04 3.12 mysql true macos-14 3.11 sqlite false
Output YAML file (test_matrix.yaml):
- os: ubuntu-22.04 python_version: "3.11" database: postgres parallel: true - os: ubuntu-22.04 python_version: "3.12" database: mysql parallel: true - os: macos-14 python_version: "3.11" database: sqlite parallel: false
Frequently Asked Questions (FAQ)
Q: What is YAML format?
A: YAML (YAML Ain't Markup Language) is a human-friendly data serialization language created in 2001. It uses indentation-based syntax to represent data structures including lists, dictionaries, and scalar values. YAML is the standard configuration format for Docker Compose, Kubernetes, Ansible, GitHub Actions, and many other DevOps and cloud tools. The current specification is YAML 1.2.
Q: Why is TSV better than CSV for this conversion?
A: TSV uses tab characters as delimiters, which virtually never appear in actual data. This eliminates the quoting issues that plague CSV files where commas in cell values require special handling. TSV is also the clipboard-native format. When you copy data from Excel or Google Sheets, the result is tab-separated. This makes TSV inherently simpler and more reliable for conversion to YAML.
Q: How does the converter handle data types?
A: The converter automatically detects data types in your TSV values. Numbers are converted to YAML integers or floats, "true"/"false" values become YAML booleans, empty cells become null, and everything else becomes quoted strings. Values that look like numbers but should be strings (like version "3.11") are properly quoted to prevent YAML parsers from interpreting them as floats.
Q: Can I use the output with Docker Compose or Kubernetes?
A: The generated YAML follows the YAML 1.2 specification and is valid for any YAML parser. However, the output structure uses a generic list of records. For Docker Compose or Kubernetes manifests, you may need to adjust the structure to match the expected schema. The converter provides a solid starting point with correctly typed values that you can restructure as needed.
Q: Is TSV the same as what I get when copying from Excel?
A: Yes! When you select cells in Excel, Google Sheets, or LibreOffice Calc and copy them to the clipboard, the data is stored in TSV format (tab-separated values). You can paste this into a text editor, save it as a .tsv file, and convert it directly to YAML. This makes TSV the most natural format for spreadsheet-to-configuration workflows.
Q: What is the difference between YAML and YML?
A: YAML and YML refer to the same format. ".yaml" is the official recommended file extension, while ".yml" is a shorter alternative commonly used in practice. Both are interchangeable and processed by the same parsers. Docker Compose uses docker-compose.yml, while Ansible typically uses .yaml. Choose whichever your project convention prefers.
Q: How are special characters handled in YAML output?
A: Values containing special YAML characters (colons, hashes, brackets, etc.) are automatically quoted to prevent parsing errors. The converter uses double quotes for strings that need escaping and leaves simple strings unquoted for readability. This ensures the generated YAML is valid and parseable by all standard YAML libraries.
Q: Can I convert large TSV files to YAML?
A: Yes, the converter handles large TSV files efficiently. However, YAML is primarily designed for configuration files, not large datasets. For TSV files with thousands of rows, the resulting YAML file will be quite large since each row becomes a multi-line list item. For very large datasets, consider JSON as an alternative target format for better performance.