Veloci Tools

YAML to JSON Converter: Free Online YAML and JSON Tool

Convert YAML to JSON or JSON to YAML instantly in your browser. Live conversion, clear syntax error messages with line and column, and adjustable indent and quoting.

119 characters

What this tool does

This tool converts between YAML and JSON in both directions, entirely inside your browser. Paste or type YAML on one side and get formatted JSON on the other, or flip the tab to go from JSON back to YAML. Conversion runs live as you type, with a short debounce so the output settles a moment after you stop typing. You can control the JSON indent width, or collapse it to a single minified line, and set the YAML indent width and quoting style used when generating YAML. If your YAML has a syntax problem, the tool shows the exact line and column where parsing failed instead of a vague error, so you can find and fix the mistake quickly.

Who it's for

Developers and DevOps engineers moving between YAML config files (Kubernetes manifests, GitHub Actions workflows, Docker Compose, CI pipelines) and JSON for scripts, APIs, or configuration validation. It is equally useful for anyone who needs to quickly sanity-check whether a YAML file is valid, or reformat a JSON API response as readable YAML for a config file.

How to use it

  1. Choose a tab: YAML to JSON or JSON to YAML.
  2. Paste or type your source content in the left panel, or click Sample data to try it.
  3. Read the converted result in the right panel, which updates automatically as you type.
  4. Adjust the JSON indent (2, 4, or minified) or the YAML indent and quoting style as needed.
  5. If there is a syntax error, check the line and column shown and fix that spot in your source.
  6. Use Copy or Download to grab the converted output.

Good to know

This tool uses standard YAML 1.2 parsing rules and JSON.parse for JSON, so exotic custom YAML tags or JSON with comments are not supported. Very large files may take a moment longer to convert since parsing happens on your device. Nothing you paste here is uploaded or stored; all conversion happens locally in your browser.

Frequently asked questions

Is any of my YAML or JSON data uploaded to a server?

No. This converter runs entirely client-side using the js-yaml library loaded in your browser. Your data never leaves your device, which makes it safe to paste configuration files that contain internal hostnames or non-sensitive settings.

Why does it say my YAML has a syntax error at a specific line?

The underlying parser reports the exact line and column where it could no longer make sense of the document, usually caused by inconsistent indentation, a missing colon, or an unquoted string containing a special character like a colon or hash. Jump to that line first since YAML errors are almost always local to where parsing actually breaks.

Can I convert a JSON array or does it need to be an object?

Both work. A top-level JSON array converts to a YAML sequence, and a top-level object converts to a YAML mapping. The same is true in reverse: a YAML document written as a list of items becomes a JSON array.

What is the difference between the indent options and quoting style?

The JSON indent setting controls how many spaces are used per nesting level, or removes all whitespace for a minified single-line result. The YAML quoting style controls whether string values are left unquoted when possible or wrapped in single or double quotes, which matters if you need consistent formatting for a linter or diff tool.

Does this tool preserve comments when converting YAML to JSON?

No. JSON has no concept of comments, so any comments in your YAML source are dropped during conversion. If you need to keep notes, add them outside the converted JSON or keep a separate annotated copy of the original YAML.

Can I use this to validate whether my YAML file is well-formed?

Yes. Paste your YAML into the YAML to JSON tab; if it parses successfully you will see the equivalent JSON, and if it does not, you will get a clear error with the line and column of the problem, which works well as a quick validator even if you do not need the JSON output.

Related tools