代码、数据与二维码工具

JSON转YAML转换器

在浏览器中将任意合法JSON根值转换为YAML 1.2;支持2/4空格缩进、80列折行或不折行、复制和YAML下载。

优先本地处理无需注册隐私说明 ↗

Enter any valid JSON value. Maximum 100,000 characters.

Wrapping changes layout only; parsed string values remain the same.

使用步骤

如何使用

  1. Paste a valid JSON value up to 100,000 characters.
  2. Choose two- or four-space indentation and whether long lines may wrap near 80 columns.
  3. Convert, review the YAML, then copy it or download a .yaml file.

YAML 1.2 with type-safe strings

The converter uses the YAML 1.2 core schema. It quotes ambiguous strings when needed so a JSON string such as “null” or “true” remains a string after a YAML parser reads it. Arrays keep their order, and object keys follow the order produced by the browser JSON parser.

JSON boundaries still apply

Comments, trailing commas, undefined, and other JavaScript-only values are not valid JSON. JSON cannot express YAML anchors, aliases, tags, or comments, so the converter does not invent them. JavaScript cannot exactly represent every large JSON integer; keep exact identifiers outside the safe integer range as strings.

常见问题

你可能还想知道

Does it accept JSON arrays and primitive values?

Yes. The root may be an object, array, string, number, boolean, or null as long as the input is valid JSON.

Will strings such as true or null change type?

No. The YAML serializer quotes strings when necessary to preserve their string type.

Does conversion upload my JSON?

No. Parsing, conversion, copying, and download preparation happen in your browser.