Convert CSV to YAML
Turn a CSV into a YAML list where each row is a record with named fields. Handy for fixtures and config. The file is converted in your browser, not uploaded.
- No daily cap
- Runs in your browser
- Typed numbers and booleans
- 2 or 4 space indent
- Runs on your device. Files are never uploaded.
- Free and unlimited. No sign-up, no watermark.
CSV to YAML in three steps
No account, no email, no waiting for an upload.
- STEP 01
Start with your CSV
The separator is detected automatically, or you can pick one.
- STEP 02
Set the options
Choose whether numbers and true/false are read as values, whether empty cells become null, and the indent.
- STEP 03
Copy or download the YAML
Each row is a list item with the header names as keys.
What CSV to YAML does, and what it doesn't
We'd rather tell you up front than surprise you after the download.
What you get
- Readable recordsEach row becomes a block of key: value lines under a dash.
- Typed valuesNumbers and booleans are written as real YAML values. Leading-zero codes such as 007 stay text and are quoted.
- Null for empty cellsTurn empty cells into null, or keep them as empty strings.
- Nested recordsWith the nesting option, headers like address.city become nested maps.
- No line wrappingLong text stays on one line.
Good to know
- Indentation choicesYAML cannot use tabs, so the Tabs option writes 2 spaces.
- No commentsA CSV has none, so the YAML has none. Add them by hand.
- Lists of lists without a headerIf you switch off the header option, rows become plain lists instead of maps.
Your data never leave your device
The tool runs inside your browser instead of on our servers, so there is nothing to upload, store or delete afterwards.
Typical online tool upload
Your file travels over the internet, sits on someone else's computer for a while, and you wait for the upload and the download.
Mediaextractr no upload
The tool loads into your browser once, then works on your file locally. Nothing is sent, so nothing can leak.
When people use CSV to YAML
Create fixtures
Turn a table of test cases into YAML for a test framework.
Write a data file for a static site
Data-driven pages often read YAML lists.
Config from a sheet
Let non-developers maintain values in a spreadsheet.
Inspect a table as a list
See each row as a record.
Mediaextractr vs typical upload tools
| MediaextractrPrivate | Typical upload tools | |
|---|---|---|
| Your file is uploaded | Never | Yes |
| Sign-up needed | No | Often, after a few files |
| Daily file limit | None | Often 1–2 free files |
| Watermark | Never | Sometimes |
| Wait for upload & download | No | Yes |
| Speed on very large files | Depends on your device | Depends on their servers |
What the YAML looks like
A CSV with the headers id and name, and two rows, becomes a YAML list of two items. Each item has id and name keys. Values that look like numbers are written without quotes if you leave typed values on.
Quoting is added when needed, for example around strings that could be mistaken for numbers or booleans.
Before you use the output
Check these points in your first conversion:
- Are IDs with leading zeros still text? Postal codes and phone numbers should be.
- Do you want blank cells as null or as empty strings?
- Validate the file with the YAML validator.
- Or convert to JSON with CSV to JSON, or back with YAML to JSON.
A small example: CSV to YAML
Take a sheet with columns sku, price and in_stock, plus two rows. The YAML is a list with two items, each holding those three keys, with price as a number and in_stock as a boolean. That list can sit inside a data file for a static site or a test suite, ready to load with any YAML parser.
Questions, answered
How do I convert CSV to YAML?
Paste the CSV and copy the YAML list it produces.
Does my CSV leave my computer during conversion?
No. The conversion is done by script in your browser tab, so no part of the file is uploaded.
How are numbers handled?
With 'Read numbers and true/false as values' on, they are written as YAML numbers. Turn it off to keep everything as text.
Should blanks be null or empty strings?
Your choice. Leave the option off for empty strings, or turn on 'Empty cells become null' to write null in the YAML.
Can I nest data from headers like a.b?
Yes, with the nesting option.
Can the conversion run on a tablet?
Yes. The same code runs in current phone and tablet browsers. Paste the CSV and copy the YAML.