Convert to YAML
LinkConvert CSV, INI, JSON, NDJSON, TOML, TSV, or XML to YAML. Paste the source or open a local file, then choose the parser and indentation settings. The conversion runs in your browser and does not upload the input.
How conversion works
LinkNDJSON becomes a YAML sequence. Each non-empty line is one sequence item and may contain any valid JSON value. Objects become mappings, arrays become nested sequences, and primitive values keep their JSON type. Invalid JSON stops the conversion and identifies the failing line.
CSV and TSV tables become sequences of mappings when the first row supplies headers. Dots in a header create nested mappings, so hello.there.general becomes three nested keys. Columns with the same path are merged into one mapping. A backslash before a dot is also accepted as a separator. Without headers, the values remain positional. CSV also lets you choose the delimiter. Type inference converts recognised numbers, booleans, and null values instead of keeping every field as text.
JSON objects, arrays, and scalar values map directly to YAML mappings, sequences, and values. TOML tables and arrays of tables become mappings and sequences. TOML comments and formatting are discarded. INI sections become nested mappings. Keys outside a section appear under global, and all INI values remain strings.
XML elements become mapping keys. Repeated elements become sequences, and text becomes a string value. The attributes key, @attributes by default, holds XML attributes. Comments, processing instructions, namespaces, and the distinction between CDATA and ordinary text are not preserved.
Output options
LinkChoose between one and eight spaces per indentation level. The converter writes block-style mappings and sequences. It puts every string in double quotes and adds escape sequences where needed. Numbers, booleans, and null values keep their types when the source parser can identify them. Invalid input produces an error instead of partial YAML.
What YAML can represent
LinkYAML is a plain-text format for structured data. A mapping associates keys with values, a sequence keeps an ordered list, and a scalar holds one value such as text, a number, a boolean, or null. Indentation shows how these values are nested.
application:
name: "Example"
enabled: true
ports:
- 80
- 443
YAML also supports comments, anchors, aliases, tags, and several styles for strings and collections. Those features describe how someone authored the YAML, not only the resulting data value.
Strings and data types
LinkPlain scalars have no quotation marks, which makes hand-written YAML compact but can make their type less obvious. Quoted strings remove that ambiguity. Single quotes treat nearly everything literally, while double quotes support escape sequences such as \n and \t. Literal block scalars with | preserve line breaks. Folded block scalars with > turn most line breaks into spaces.
A parser infers numbers, booleans, and null values from their spelling and the schema it implements. YAML versions and parser libraries have not always agreed on every spelling. Quoting text such as dates or values with leading zeroes prevents an unintended type conversion. This converter quotes all strings so that they remain strings when another parser reads the output.
Anchors, aliases, and document structure
LinkAn anchor names a node with &, and an alias refers back to it with *. Tags written with ! can identify a value type or ask an application to construct a specific object. YAML can also contain directives and several documents in one stream, separated with ---.
These capabilities are useful in hand-maintained configuration, but they have no direct counterpart in JSON, CSV, TSV, or INI. The converter writes the resolved data as one document rather than trying to recreate authoring choices that the parsed value no longer contains.
Where YAML is used
LinkYAML is common in application settings, build pipelines, deployment manifests, and infrastructure configuration. Its block syntax keeps nested mappings readable, but indentation is part of the grammar. Tabs cannot indent structure, and a misplaced space can change which mapping or sequence owns a value. Schema validation remains separate from parsing, just as it does with JSON.
What may be lost
LinkThe converter writes one YAML document without comments, anchors, aliases, custom tags, directives, or document markers. It does not preserve whether a source YAML string used quotes or a block style. XML namespaces, mixed content, comments, and processing instructions cannot be reproduced faithfully either.
CSV and TSV offer little type information unless you enable inference. INI values always remain strings. Check dates, large numbers, values with leading zeroes, and other text that another YAML parser might interpret differently.
The converter reads the complete input and output into memory. It suits ordinary configuration files and datasets, not very large exports.
Files, privacy, and saved work
LinkSelect a local file. A recognised extension selects the matching input type. The browser reads the file locally and does not upload it.
The selected format, each format’s input, parser settings, and YAML indentation are stored in localStorage. Switching formats does not overwrite another format’s text. Clear the fields or site data after handling sensitive information on a shared device.
Related tools
Link- Convert to CSV
- Convert to INI
- Convert to JSON
- Convert to NDJSON
- Convert to TOML
- Convert to TSV
- Convert to XML
Widget made with staark