CSV to YAML Converter
Paste a CSV and get a YAML list in which each row is a mapping keyed by the header. Prettify detects comma, tab, semicolon, and pipe delimiters, reads quoted fields correctly, and skips a metadata block above the header. The conversion runs in your browser.
How rows become YAML
The header row supplies the keys. Each later row becomes one item in a YAML list, and each cell becomes a value under its column name. The output is block-style YAML with two-space indentation.
CSV cells are text, so every value is a string. Prettify quotes a value when plain style would change its meaning. For example, 1 is written as '1' and true as 'true', so a YAML reader gets back the same text you had.
Key features
A CSV is only as clean as its parser. Prettify reads the file the way a spreadsheet export is usually written, so the common quirks of exported files are handled for you.
- Comma, tab, semicolon, and pipe delimiters are detected, and a first line of sep=; is honored.
- A quoted field with a comma or a line break inside it stays one value.
- A header that sits below a block of metadata lines is found, and Prettify leaves the metadata out and warns you.
- An empty cell becomes an empty string, not null.
- A row with more fields than the header keeps the extra values under generated names, such as Column 3.
- A duplicate header name is renamed, so no column overwrites another.
How to convert CSV to YAML
Convert in the box on this page, then continue in the editor. The box reads documents up to 512 KB. If the CSV cannot be read, the panel shows the problem, and the button reads "Fix it in the editor".
- Paste your CSV into the box labeled "Paste your CSV", or select "Try an example".
- Read the YAML in the result panel. The line under the summary shows a warning when Prettify left something out.
- Select Copy to put the YAML on the clipboard, or select Download to save it as prettify.yaml.
- Select "Open in full editor". The editor opens at /app/editor with the YAML in the Raw view.
- Switch to the Tree view in the editor to check the structure.
- For a larger file, open the CSV in the editor, select Convert in the Transform group of the toolbar, and pick YAML.
Worked example: a team list
The CSV below has a quoted name that contains a comma, and one empty cell. The block after it is the YAML that Prettify produces.
The quotes around "Ruiz, Ana" are CSV syntax, so they are gone from the YAML, and the comma stays inside one value. The dates and the words true and false are quoted, because the cell is text and the quotes keep it text. Sam has no role, so that value is an empty string. If a tool needs real booleans, remove the quotes in the YAML, because YAML reads an unquoted true as a boolean.
name,role,start,active
"Ruiz, Ana",admin,2024-01-05,true
Lee Park,editor,2023-11-20,false
Sam,,2024-03-01,true
- name: Ruiz, Ana
role: admin
start: '2024-01-05'
active: 'true'
- name: Lee Park
role: editor
start: '2023-11-20'
active: 'false'
- name: Sam
role: ''
start: '2024-03-01'
active: 'true'Common uses
A spreadsheet is a good place to collect data, and YAML is a good place to keep it in a repository. This converter links the two without retyping a single value.
- Turn a spreadsheet of settings or feature flags into a YAML file for a config repository.
- Create YAML data files for a static site generator from a table.
- Build test fixtures from a CSV export.
- Check how a CSV export will look as structured data before an import.
- Share a small table in a format that reads well in a pull request.
Limits to know
Prettify does not guess types in a CSV. Every value in the YAML is text, even a column of numbers. A CSV with only a header row gives an empty list, written as []. Date-like text such as 2024-01-05 stays text, and Prettify writes it in quotes so that a YAML reader does not turn it into a date.
The metadata lines above a header are text, and YAML has no place for them, so they are dropped. The warning counts the lines it left out. If you need them, copy them from the source file.
Frequently asked questions
Is the CSV to YAML converter free?
Yes. Reading the CSV, converting it, and copying or downloading the YAML is free and needs no account. SQL queries over the CSV are a Pro feature, and you do not need them to convert.
Does my CSV leave my device?
No. Parsing and conversion run in your browser, so an export with customer or finance data is not uploaded. Prettify sends data only when you create a share link.
How do I get numbers and booleans instead of strings?
Prettify keeps CSV cells as text, so it does not turn them into numbers or booleans on its own. Remove the quotes around those values in the YAML. Plain 8080 is a number, and plain true is a boolean.
What happens to the lines above my header?
Report exports often start with a few lines of metadata. Prettify finds the real header below them, converts the rows, and leaves the metadata lines out of the YAML. It tells you how many lines it left out.
Does a TSV file work?
Yes. A tab-separated file is a CSV with a tab delimiter, and Prettify detects the delimiter on its own. Paste the TSV into the box, and the YAML matches what a comma-separated file gives.
Can I convert the YAML back to CSV?
Yes. The YAML to CSV page converts a list of flat mappings back to a table, with the keys as the header. Values come back as plain text.