᠎᠎᠎          
51K

Csv to yaml converter

World's simplest csv tool
Free online CSV to YAML converter. Just upload your CSV file in the form below and it will automatically get converted to a YAML file. In the tool options, you can specify the field delimiter character, field quote character, and comment character to adapt the tool to custom CSV formats. Additionally, you can select the output YAML format: one that preserves CSV headers or one that excludes CSV headers. Created by programmers from team Browserling.
love tabs more than commas? foo\tbar\tbaz
We also have Online TSV Tools — utilities for working with tab separated values. Check it out!
Adjust Input CSV
Set the symbol that separates fields in the input CSV.
Set the symbol that's used to quote CSV fields.
Set the symbol that starts comment lines in a CSV file.
Adjust Conversion
Use the fields in the first row of the CSV as keys to set the key names of YAML dictionaries.
If a CSV row contains no characters, skip it.
Adjust YAML Indentation
Set the number of spaces to use for YAML indentation.

What is a csv to yaml converter?

learn more about this tool
This tool transforms CSV (Comma Separated Values) data into the YAML (Yet Another Markup Language) data. CSV is a simple, tabular format that's used to represent matrix-like data types consisting of rows and columns. YAML, on the other hand, is a more advanced format (actually a superset of JSON), which creates more human-readable data for serialization, and it supports lists, dictionaries, and nested objects. This program supports various input CSV formats – the input data can be comma-separated (default), semicolon-separated, pipe-separated, or use another completely different delimiter. You can specify the exact delimiter your data uses in the options. Similarly, in the options, you can specify the quote character that's used to wrap CSV fields (by default a double-quote symbol). You can also skip lines that start with comments by specifying the comment symbols in the options. This allows you to keep your data clean by skipping unnecessary lines. There are two ways to convert CSV to YAML. The first method converts each CSV row into a YAML list. The second method extracts headers from the first CSV row and creates YAML objects with keys based on these headers. You can also customize the output YAML format by specifying the number of spaces for indenting YAML structures. If you need to perform the reverse conversion, that is, transform YAML into CSV, you can use our Convert YAML to CSV tool. Csv-abulous!

Csv to yaml converter examples

Click to use
Convert Music Playlist CSV to YAML
In this example, we transform a short CSV file containing a music playlist into structured YAML data. The input CSV contains five records with three columns each and the output YAML contains five lists of lists (one list for each CSV record). In YAML, lists start with the "-" symbol and the nested lists are indented with two spaces.
The Beatles,"Yesterday",Pop Rock Queen,"Bohemian Rhapsody",Rock Nirvana,"Smells Like Teen Spirit",Grunge Michael Jackson,"Billie Jean",Pop Stevie Wonder,"Superstition",Funk
- - The Beatles - Yesterday - Pop Rock - - Queen - Bohemian Rhapsody - Rock - - Nirvana - Smells Like Teen Spirit - Grunge - - Michael Jackson - Billie Jean - Pop - - Stevie Wonder - Superstition - Funk
Required options
These options will be used automatically if you select this example.
Set the symbol that separates fields in the input CSV.
Set the symbol that's used to quote CSV fields.
Set the symbol that starts comment lines in a CSV file.
Use the fields in the first row of the CSV as keys to set the key names of YAML dictionaries.
If a CSV row contains no characters, skip it.
Set the number of spaces to use for YAML indentation.
Planetary CSV Data
In this example, we're working with CSV data that summarizes key properties of three planets in our solar system. The data consists of three columns with headers "planet", "relative mass" (with "1" being Earth's mass), and "satellites". To preserve the header names in the output YAML data, we enable the "Transform Headers" option, creating a YAML file that contains a list of YAML objects, where each object has three keys: "planet", "relative mass", and "satellites".
planet,relative mass,satellites Venus,0.815,0 Earth,1.000,1 Mars,0.107,2
- planet: Venus relative mass: '0.815' satellites: '0' - planet: Earth relative mass: '1.000' satellites: '1' - planet: Mars relative mass: '0.107' satellites: '2'
Required options
These options will be used automatically if you select this example.
Set the symbol that separates fields in the input CSV.
Set the symbol that's used to quote CSV fields.
Set the symbol that starts comment lines in a CSV file.
Use the fields in the first row of the CSV as keys to set the key names of YAML dictionaries.
If a CSV row contains no characters, skip it.
Set the number of spaces to use for YAML indentation.
Convert Non-standard CSV to YAML
In this example, we convert a CSV file with non-standard formatting into a regular YAML file. The input data uses a semicolon as a separator for the "product", "quantity", and "price" fields. It also contains empty lines and lines that are commented out. To make the program work with this custom CSV file, we input the semicolon symbol in the CSV delimiter options. To skip comments, we specify "#" as the symbol that starts comments. And to remove empty lines, we activate the option for skipping blank lines (that don't contain any symbols). In the output, we obtain a YAML file that contains a list of three objects, which use CSV headers as keys. Additionally, the objects in the YAML file are indented with four spaces.
item;quantity;price milk;2;3.50 #eggs;12;2.99 bread;1;4.25 #apples;4;1.99 cheese;1;8.99
- item: milk quantity: '2' price: '3.50' - item: bread quantity: '1' price: '4.25' - item: cheese quantity: '1' price: '8.99'
Required options
These options will be used automatically if you select this example.
Set the symbol that separates fields in the input CSV.
Set the symbol that's used to quote CSV fields.
Set the symbol that starts comment lines in a CSV file.
Use the fields in the first row of the CSV as keys to set the key names of YAML dictionaries.
If a CSV row contains no characters, skip it.
Set the number of spaces to use for YAML indentation.
Pro tips Master online csv tools
You can pass input to this tool via ?input query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!
https://onlinecsvtools.com/convert-csv-to-yaml?input=The%20Beatles%2C%22Yesterday%22%2CPop%20Rock%0AQueen%2C%22Bohemian%20Rhapsody%22%2CRock%0ANirvana%2C%22Smells%20Like%20Teen%20Spirit%22%2CGrunge%0AMichael%20Jackson%2C%22Billie%20Jean%22%2CPop%0AStevie%20Wonder%2C%22Superstition%22%2CFunk&char-delimiter=%2C&char-comments=%23&char-quote=%22&convert-headers=false&convert-skip-empty=false&formatting-number-of-spaces=2
All csv tools
Didn't find the tool you were looking for? Let us know what tool we are missing and we'll build it!
Quickly convert a CSV file to a JSON data structure.
Quickly convert a JSON data structure to a CSV file.
Quickly convert a CSV file to an XML file.
Quickly convert an XML file to a CSV file.
Quickly convert a CSV file to a YAML file.
Quickly convert a YAML file to a CSV file.
Quickly convert a CSV file to a TSV file.
Quickly convert a TSV file to a CSV file.
Quickly convert a CSV file to evenly aligned text columns.
Quickly convert text columns to a CSV file.
Quickly encode CSV to base64.
Quickly decode base64 to CSV.
Quickly convert CSV to URL-encoding.
Quickly decode CSV from URL-encoding.
Quickly change the CSV column delimiter to a new symbol.
Quickly prepend columns at the beginning of a CSV file.
Quickly append one or more new columns at the end of a CSV file.
Quickly insert one or more new columns anywhere in a CSV file.
Quickly export one or more columns from a CSV file.
Quickly replace one or more columns in a CSV file.
Quickly delete one or more columns from a CSV file.
Quickly swap two columns in a CSV file.
Quickly exchange columns with rows in a CSV file.
Quickly exchange rows with columns in a CSV file.
Quickly transpose a CSV file.
Quickly truncate columns in a CSV file.
Quickly left-trim and right-trim column values in a CSV file.
Coming soon These csv tools are on the way
Edit CSV in the Browser
Edit the contents of a CSV file in a neat editor.
Deduplicate CSV Data
Remove duplicate rows in a CSV file.
Print CSV Statistics
Display detailed information about a CSV file.
Convert CSV to HTML
Convert a CSV file to an HTML table.
Convert HTML to CSV
Convert an HTML table to a CSV file.
Convert CSV to Markdown
Convert a CSV file to a Markdown table.
Convert Markdown to CSV
Convert a Markdown table to a CSV file.
Convert CSV to ASCII Table
Draw an ASCII table from CSV data.
Convert CSV to ANSI Table
Draw an ANSI table from CSV data.
Convert CSV to Unicode Table
Draw a Unicode table from CSV data.
Convert CSV to PDF
Convert CSV to a PDF document.
Convert PDF to CSV
Extract data from a PDF and create a CSV file.
Convert CSV to an Image
Draw a CSV file as a PNG, JPG or GIF picture.
Convert Image to CSV
Extract data from an image and create a CSV file.
Convert CSV to Excel
Convert a CSV file to an Excel spreadsheet.
Convert Excel to CSV
Convert an Excel spreadsheet to a CSV file.
Convert CSV to vCard
Convert a CSV file to a vCard file.
Convert vCard to CSV
Convert a vCard file to a CSV file.
Convert CSV to LaTeX
Convert CSV to a LaTeX table.
Convert CSV to SQL
Generate SQL queries from a CSV file.
Convert CSV to INI
Convert a CSV file to an INI file.
Convert INI to CSV
Convert an INI file to a CSV file.
Convert CSV to JSONL
Convert a CSV file to a JSONL (JSON Lines) file.
Convert JSONL to CSV
Convert a JSONL (JSON Lines) file to a CSV file.
Convert CSV to TXT
Convert a CSV file to a plain text file.
Convert TXT to CSV
Convert a plain text file to a CSV file.
Convert CSV to SSP
Convert a CSV file to a semicolon-separated file (SSP).
Convert SSP to CSV
Convert a semicolon-separated file (SSP) to a CSV file.
Convert CSV to HSP
Convert a CSV file to a hash-separated file (HSP).
Convert HSP to CSV
Convert a hash-separated file (HSP) to a CSV file.
Convert CSV to PSP
Convert a CSV file to a pipe-separated file (PSP).
Convert PSP to CSV
Convert a pipe-separated file (PSP) to a CSV file.
Convert CSV to SQLite
Create an SQLite database from the given CSV file.
Convert SQLite to CSV
Export tables from an SQLite database as CSV files.
Convert CSV to GeoJSON
Convert a CSV file to a GeoJSON file.
Convert GeoJSON to CSV
Convert a GeoJSON file to a CSV file.
Merge CSV Files
Merge together two or more CSV files.
Compare Two CSV Files
Visually show the differences between two CSV files.
Diff Two CSV Files
Run the diff algorithm on two CSV files.
Find Data in CSV
Find CSV cells that contain certain data.
Filter CSV Cells
Return data in a CSV file that matches a pattern.
Rotate CSV Columns
Move CSV columns to the left or right.
Rotate CSV Rows
Move CSV data rows up or down.
Sort CSV Columns
Sort the data in one or more CSV columns.
Sort CSV Rows
Sort the data in one or more CSV rows.
Shuffle CSV Columns
Randomly change the positions of CSV columns.
Shuffle CSV Rows
Randomly change the order of CSV rows.
Shuffle CSV Values
Randomly change the order of all CSV values.
Rename CSV Columns
Change the name of CSV columns.
Create a Random CSV
Generate a random CSV of any size.
Create an Empty CSV File
Generate a CSV file that contains nothing.
Create a Large CSV File
Generate a large CSV file for testing.
Create a Custom CSV File
Generate a custom CSV file with m rows and n columns.
Unquote CSV Fields
Remove double quotes from all CSV fields.
Quote CSV Fields
Wrap all CSV fields in double quotes.
Change CSV Quote Character
Change the character that CSV fields are wrapped in.
Delete Empty CSV Columns
Delete columns that are completely empty.
Delete Empty CSV Rows
Delete rows that are completely empty.
Delete Empty CSV Values
Delete all items in a CSV file that are empty.
Remove CSV Separator
Delete the comma separator from CSV files.
Delete CSV Comments
Delete comments (lines starting with # or //) from CSV files.
Delete CSV Header
Delete the column header from a CSV file.
Compress a CSV File
Minify a CSV file and remove unnecessary whitespaces.
Optimize CSV File Size
Reduce the file size of a CSV file.
Change CSV Encoding
Change the character encoding of a CSV file to UTF8 or ISO-8859-1.
Add Extra Spaces in CSV
Add extra spaces between CSV columns.
Convert CSV to a Matrix
Convert a CSV file to an m-by-n matrix.
Convert CSV to an Array of Arrays
Convert a CSV file to an array of arrays of fields.
Convert an Array of Arrays to CSV
Convert an array of arrays of fields to a CSV file.
Convert CSV Columns to an Array
Convert CSV columns to a flat array or a list.
Convert CSV Rows to an Array
Convert CSV rows to a flat array or a list.
Find CSV Dimensions
Find the number of rows and columns of a CSV file.
Sum CSV Columns
Find the sum of CSV columns.
Sum CSV Rows
Find the sum of CSV rows.
Add Color to CSV
Use different colors for CSV data, quotes, and commas.
Animate a CSV File
Animate CSV data by showing column after column.
Fix a Broken CSV
Automatically fix a broken CSV.
Add Errors to CSV
Introduce random errors to a CSV file for fuzz testing.
Anonymize CSV Data
Hide personal or sensitive information in a CSV file.
Encrypt CSV
Encrypt a CSV file and hide information in it.
Decrypt CSV
Decrypt a previously encrypted CSV file and make it readable.
Validate CSV
Make sure the given CSV file doesn't have formatting errors.
Visualize CSV
Create a visual drawing that shows the CSV structure.
Create a CSV File
Create a new CSV file in the browser.
CSV Viewer
Preview the contents of a CSV file in an interactive editor.