Nekonote Toolbox logo

Nekonote Toolbox

Free browser-based tools for developers and IT admins.

日本語

YAML ↔ JSON Converter

About this tool

Convert Kubernetes manifests, docker-compose files, CI configuration and OpenAPI specs between YAML and JSON. Conversion happens as you type, and a syntax error shows the line and column where it was found.

Everything runs in your browser. Your configuration, which may contain secrets, is never sent to a server.

How it works

  • Parsing uses the open-source js-yaml 4.1.0 library, which follows YAML 1.2. In this version, yes, no and on stay strings, not booleans. Check the output if you rely on YAML 1.1 behavior.
  • Comments are lost. JSON has no comments, and a round trip through JSON drops them from YAML as well. Key order is kept unless you tick Sort keys.
  • Anchors and aliases (&name, *name, <<:) are expanded into plain copies in the JSON. Going back to YAML does not recreate them.
  • Dates such as 2024-05-01 are read as timestamps and written to JSON as ISO 8601 strings ("2024-05-01T00:00:00.000Z").
  • If the YAML contains several documents separated by ---, the result is a JSON array with one item per document.
  • JSON to YAML does not wrap long lines. Strings that contain newlines are written in a readable block style when possible.
  • Numbers beyond 253 lose precision in JSON parsing, the same as in JavaScript. Quote them as strings if you need every digit.

FAQ

Q. The parser reports an error on a line that looks fine.

A. In YAML, indentation is the structure, and tabs are not allowed for indentation. The reported line is where the parser gave up, which is often the line after the real mistake. Look for a missing space after a colon, mixed tabs and spaces, or an unquoted value that contains : or #.

Q. Will it run code inside my YAML?

A. No. js-yaml 4 uses a safe schema by default and does not construct functions or arbitrary objects.