跳到主要内容

JSON / YAML 互转

UpBox优盒工具箱,免费 JSON 与 YAML 互转工具,支持双向转换、缩进设置、错误提示与文件下载,本地处理不上传。

无需注册 · 数据不上传No sign-up · nothing uploaded

原始内容Input

转换结果Result

字符数0
行数0
粘贴内容后自动转换
本工具所有运算在本地浏览器完成,你的文件、文本不会上传到服务器

工具介绍

JSON 与 YAML 互转在浏览器里完成:一边粘贴源内容,另一边立即得到目标格式,不会上传任何数据。 JSON and YAML convert right in the browser: paste the source on one side and get the target format on the other, with nothing uploaded.

支持对象、数组、嵌套与布尔值;缩进可选 2 或 4 个空格。格式有误时会清空结果并给出提示,避免把半成品复制走。 Objects, arrays, nesting and booleans all work, with 2- or 4-space indentation. Invalid input clears the result and shows a hint, so no half-converted text gets copied.

  • 双向转换Both directions
  • 2 / 4 空格缩进2 or 4 space indent
  • 格式错误提示Invalid-format hint
  • 复制与下载Copy and download
  • 本地处理不上传Runs locally

使用说明

  1. 在左栏粘贴 JSON 或 YAML。Paste JSON or YAML on the left.
  2. 选择转换方向,以及 2 或 4 空格缩进。Choose the direction and 2- or 4-space indent.
  3. 结果自动生成,可点“转换”再执行一次。The result updates automatically; press Convert to rerun.
  4. 复制结果,或下载 upbox-data.json / .yaml。Copy the result, or download upbox-data.json / .yaml.

常见问题

YAML 的注释会保留吗?Are YAML comments preserved?
转成 JSON 时不会。JSON 本身不支持注释,注释内容会被丢弃。No. JSON has no comments, so they are dropped when converting to JSON.
键的顺序会变吗?Will key order change?
按源文件中的顺序输出,不做排序,便于对比。Keys keep their source order; nothing is sorted, which makes comparison easier.
支持多文档 YAML 吗?Are multi-document YAML files supported?
当前按单文档解析。含 `---` 分隔的多文档需要拆开分别转换。One document at a time. Split files separated by `---` and convert them individually.
数据会上传吗?Is my data uploaded?
不会。转换由本机加载的 js-yaml 完成,没有网络请求。No. Conversion runs on the locally hosted js-yaml with no network request.
广告位

此处为广告位,可放置你的推广素材

支持图片、文字或 HTML 代码,替换本区块内容即可投放

浏览其他分类