Convert YAML to JSON and JSON to YAML, with the exact line and column of any syntax error.
YAML and JSON describe the same thing — maps, lists, strings, numbers, booleans and null — with opposite priorities. JSON uses braces and quotes, which machines like and people mistype. YAML uses indentation and almost no punctuation, which people like until a stray space changes the shape of the document. Converting between them is routine work: reading a Kubernetes manifest or a GitHub Actions workflow as JSON so a script can consume it, or turning an API response back into YAML for a config file. This tool goes both ways and detects which one you pasted.
The conversion is the easy half; what happens when the YAML is broken is where this tool spends its effort. A syntax error is reported as a line and a column counted the way an editor counts them, with a snippet of the surrounding lines and a caret under the exact character that stopped the parser. The position is not always where you expect. A tab used for indentation is refused at the tab itself, and the snippet prints it as an arrow so you can see the thing you cannot see. An unclosed quote is reported at the end of the file, not at the opening quote, because that is where the parser ran out of text looking for the closing one. A duplicated key is flagged at its second occurrence, and it is an error here, not a warning. JSON errors get the same treatment: browsers word them differently and some report only a character offset, so the line and column are computed here and come out identical everywhere.
YAML can express things JSON cannot, and every one of them is called out instead of quietly changing your data. Anchors and aliases are expanded, so an alias becomes a full copy of the anchored value, and you are told. Merge keys are not: the parser runs on the JSON schema, which does not resolve them, so a << line survives as a literal key with a warning to merge those fields by hand. A file holding several documents separated by --- becomes a JSON array, one item per document. The values .inf and .nan come out as null, and huge integers lose their last digits; both are flagged. That schema is also a safety choice: tags such as !!js/function are rejected as unknown rather than instantiated. And none of it travels — everything runs on your device.
No. The text is parsed and converted by JavaScript on your own device — nothing is sent anywhere, stored or logged. That matters here: a Kubernetes manifest carries hostnames, ports, bucket names and service accounts.
They are where the parser gave up, counted from 1 like in your editor, with the caret under that character. One case surprises people: an unclosed quote is reported at the end of the file, so look back for the last quote you opened.
Yes. Each alias becomes a full copy of the anchored value in the JSON, and the tool says so. Merge keys are the exception: they are not resolved, the << survives as a literal key, and you get an explicit warning instead of a silently wrong result.
Yes. JSON has no concept of multiple documents in one file, so each YAML document becomes one item of a JSON array, in order, and a notice says how many were found.
Because YAML 1.2 treats only true and false as booleans; yes, no, on and off stay strings. Older 1.1 parsers converted them — the same rule that turns the country code NO into false. Quote a value whenever it must stay text.
Vai.la turns any URL into a short link with click statistics, QR Code and your own biolink.
Vai.la is not responsible for how the tools are used or for decisions made based on their results.