Convert CSV to YAML
Convert CSV to YAML with smart type detection, multi-line block scalars, reserved-word quoting (no false-boolean traps). Free, offline, client-side, instant.
- Runs in your browser
- Nothing uploaded
- Free, no sign-up
Convert CSV/TSV to YAML with 3 type-coercion modes (preserves "007" ZIP codes), multi-line block scalars (| for embedded newlines), and YAML reserved-word quoting - cells like "yes", "no", "null" are auto-quoted so they don't accidentally become booleans/null on the way back through a YAML parser.
How to Use Convert CSV to YAML
- Paste CSV into the input pane, upload a
.csv/.tsvfile, or click Load sample. - Pick a delimiter (auto-detect handles comma/semicolon/tab/pipe).
- Toggle First row is headers. Headerless mode emits
field1,field2, … - Pick a type-coercion mode: All strings (safest, preserves "007"), Smart with safe IDs (default - leading-zero strings and UUIDs stay strings), Auto-detect (full conversion, may lose "007" ZIP codes - warning shown).
- Pick an output style: block (multi-line, human-readable) or flow (single-line JSON-like array).
- YAML reserved words (
true,false,yes,no,on,off,null,~- all case-insensitive) are auto-quoted to preserve string identity. A cell containing"yes"in your CSV stays the string"yes"in YAML, not the booleantrue. - Cells with embedded newlines automatically use the
|block literal scalar - preserving line breaks readably. - Copy or download
data.yaml.
Frequently Asked Questions
What’s the “Norway Problem”?
YAML 1.1 treats NO (the ISO country code for Norway) as the boolean false. So a CSV column listing country codes including NO becomes a list with false in it after YAML parse – Norway disappears. Same for ON (Ontario), OK (Oklahoma, though that’s not a YAML keyword). YAML 1.2 fixed this for new parsers, but Ruby, Go, Python’s PyYAML default mode still use 1.1 semantics. The tool always quotes these to be safe.
When should I use block vs flow style?
Block (default): - name: Janen age: 30 – human-readable, easy to diff, the YAML idiom. Flow: [{name: Jane, age: 30}] – compact, similar to JSON, faster to grep. Use block for config files; use flow for JSON-like data interchange or when YAML is one line in a larger file.
How does multi-line scalar work?
If a CSV cell contains a newline (typical for description / note fields with line breaks), the tool emits it as a | block literal: note: |n first linen second line. The pipe | tells YAML “this is a literal string, preserve newlines as-is”. Alternative: > (folded scalar) collapses newlines to spaces but the tool uses literal because that matches what you put in.
Does YAML support comments?
Yes – lines starting with # are comments. This tool doesn’t currently emit comments (CSV doesn’t have any to convert), but the YAML it produces accepts comments. Add them manually after conversion if needed for documentation.
Why are some values quoted and others aren’t?
YAML quoting rules: required for strings containing :, #, brackets, newlines (unless using block literal), or strings that LOOK like other types (numbers, booleans, null, reserved words). Strings like Jane or simple text don’t need quotes. Strings like "yes" or "007" or "contains: a colon" do. The tool quotes only when needed.
Does it handle UUIDs correctly?
Yes. UUIDs (550e8400-e29b-41d4-a716-446655440000) contain hyphens and look numeric-ish to naive parsers. In “Safe IDs” mode, the tool detects the letter-and-hyphen pattern and treats them as strings – preserving the format.
What’s the YAML 1.1 vs 1.2 problem?
YAML 1.1 (still default in many parsers): treats yes/no/on/off as booleans, octal numbers via 0 prefix, sexagesimal numbers via :. YAML 1.2 (newer spec): only true/false for booleans, only 0o prefix for octal. This tool quotes proactively so output works in BOTH versions safely.
Can I use this YAML in Docker Compose, Kubernetes, GitHub Actions?
Yes. Block-style output is the standard for: docker-compose.yml, Kubernetes manifests, GitHub Actions workflows (.github/workflows/*.yml), GitLab CI, Ansible playbooks. Each of those uses YAML 1.1 semantics (mostly), so the tool’s quoting helps avoid surprise behavior.
Is my data secure?
Yes. CSV input + uploaded files + generated YAML all stay in your browser. Nothing is uploaded.
Related Tools
YAML to CSV Converter →
Convert a YAML list of items into CSV, with keys as columns and values…
Convert CSV to JSON →
Convert CSV/TSV to JSON with delimiter auto-detect, type coercion options, nested keys, 4 output…
Convert CSV to Markdown Table →
Convert CSV to GitHub-flavored Markdown table with per-column alignment, HTML preview, delimiter auto-detect. Free,…
Convert CSV to PDF Table →
Convert CSV to formatted PDF tables in your browser. Custom orientation, font size, alternate…
Convert CSV to XML →
Convert CSV to XML with custom tag names, element/attribute modes, CDATA wrap, headerless mode.…
CSV Viewer →
View CSV/TSV files as a searchable, sortable table. RFC 4180 parser, XSS-safe rendering, file…
JSON to CSV Converter →
Convert a JSON array of objects into CSV, with keys as columns and values…
JSON to YAML Converter →
Convert JSON into readable YAML, using indentation for nesting and quoting where needed.
XML to YAML Converter →
Convert XML into readable YAML that mirrors the document tree, with indentation for nesting.
YAML to JSON Converter →
Convert YAML with nested mappings and lists into JSON, with types detected.
YAML to TOML Converter →
Convert a YAML mapping into TOML, with nested mappings as tables and lists as…
YAML Validator →
Validate YAML and catch common mistakes, with a summary of the parsed structure.