F

JSON 转换工具JSON Converter

JSON与XML/CSV/YAML格式互相转换Convert JSON to/from XML, CSV and YAML formats.

关于 JSON 转换工具About JSON Converter

不同系统偏爱不同的结构化格式:配置文件喜欢 YAML,表格数据喜欢 CSV,老旧接口偏爱 XML。本工具支持 JSON 与 XML、CSV、YAML 互相转换,省去手写转换脚本的麻烦,转换过程完全在本地完成。Different systems favour different structured formats: configs love YAML, tabular data loves CSV, and legacy APIs love XML. This tool converts JSON to and from XML, CSV and YAML, saving you from writing conversion scripts — entirely locally.

使用方法How to Use

  1. 将源数据粘贴到输入区域。Paste the source data into the input area.
  2. 选择源格式与目标格式,例如 JSON → YAML。Choose the source and target formats, e.g. JSON → YAML.
  3. 点击转换,在输出区域检查字段与层级是否符合预期。Click convert and check the output for expected fields and hierarchy.
  4. 若结果不理想,检查源数据结构是否规整(如 CSV 是否带表头行)。If the result is off, verify the source is well-formed (e.g. whether the CSV has a header row).

常见问题FAQ

CSV 转 JSON 需要什么结构?What structure does CSV-to-JSON need?

第一行需为表头,其后每一行会转换为一个对象,键名取自表头。缺少表头会导致字段名错乱。The first row must be a header; each following row becomes an object keyed by the header names. A missing header produces garbled field names.

嵌套很深的 JSON 转 CSV 会怎样?What happens to deeply nested JSON converted to CSV?

CSV 本质是二维表,深层嵌套字段会被展平或序列化为字符串。结构复杂的数据建议改用 YAML 或保留 JSON。CSV is essentially a flat table, so deep fields get flattened or serialized as strings. For complex structures prefer YAML or keep JSON.

转换是可逆的吗?Is the conversion reversible?

不一定。各格式表达能力不同,例如 XML 的属性、注释转成 JSON 时可能丢失信息,转换后请核对关键字段。Not always. Formats differ in expressiveness — XML attributes or comments may lose information when converted to JSON, so verify key fields afterwards.

相关阅读Related Reading

相关工具Related Tools