首页 Home/多格式互转 / Data Format Converter

多格式互转 · Data Format Converter

配置文件和数据交换中经常需要在不同格式之间转换:JSON 适合程序处理,YAML 可读性好,TOML 常用于配置,CSV / TSV 适合表格数据。手动改写既耗时又容易出错。

Config files and data exchange often require converting between formats: JSON is machine-friendly, YAML is readable, TOML is common for configuration, and CSV / TSV fit tabular data. Rewriting by hand is slow and error-prone.

多格式互转Data Format Converter
INPUT0 chars
OUTPUT
结果会显示在这里
提示:所有处理都在你的浏览器本地完成。输入后自动更新结果

多格式互转 / Data Format Converter

功能介绍(中文)

配置文件和数据交换中经常需要在不同格式之间转换:JSON 适合程序处理,YAML 可读性好,TOML 常用于配置,CSV / TSV 适合表格数据。手动改写既耗时又容易出错。

本工具支持 JSON、YAML、TOML、CSV、TSV 五种格式两两互转,一键交换输入输出方向。YAML 支持缩进映射与序列、行内结构、块标量和注释;TOML 支持表、数组表、点号键、行内表和数字下划线;CSV / TSV 正确处理引号转义与字段内换行。

所有解析和生成都由内置的本地脚本完成,不请求任何外部 CDN,数据始终留在浏览器中。

Overview (English)

Config files and data exchange often require converting between formats: JSON is machine-friendly, YAML is readable, TOML is common for configuration, and CSV / TSV fit tabular data. Rewriting by hand is slow and error-prone.

This tool converts between JSON, YAML, TOML, CSV and TSV in any direction, with a one-click swap. YAML support covers indented maps and sequences, inline structures, block scalars and comments; TOML supports tables, array tables, dotted keys, inline tables and numeric underscores; CSV / TSV handle quoted escaping and newlines inside fields.

All parsing and generation run in bundled local scripts with no external CDN requests, so your data stays in the browser.

功能特点(中文)

  • JSON / YAML / TOML / CSV / TSV 五种格式两两互转
  • 一键交换输入输出方向
  • 支持 YAML 块标量与注释、TOML 数组表
  • CSV / TSV 正确处理引号与字段内换行
  • 无外部依赖,全部本地解析

Features (English)

  • Convert between JSON, YAML, TOML, CSV and TSV
  • One-click input / output swap
  • YAML block scalars and comments, TOML array tables
  • CSV / TSV handle quotes and embedded newlines
  • No external dependencies, fully local parsing

常见问题 / FAQ

JSON 和 YAML 有什么区别?

JSON 是严格的数据格式,语法简洁、机器解析快,不支持注释;YAML 可读性更强,支持注释和更宽松的写法,常用于配置文件。二者可以表达大部分相同的数据结构。

What is the difference between JSON and YAML?

JSON is a strict data format with concise syntax and fast parsing but no comments; YAML is more human-readable, supports comments and relaxed syntax, and is common in config files. They can express mostly the same data structures.

CSV 和 TSV 有什么区别?

CSV 用逗号分隔字段,TSV 用制表符分隔。字段中包含分隔符或换行时必须用引号包裹。本工具以首行作为表头,把每行数据转换成对象。

What is the difference between CSV and TSV?

CSV uses commas as delimiters and TSV uses tabs. Fields containing the delimiter or newlines must be quoted. This tool treats the first row as headers and converts each subsequent row into an object.

← 返回全部工具 / All tools

已复制到剪贴板