JSON
JSON ↔ YAML / CSV / XML / TOML
JSON を YAML、CSV、XML、TOML に変換、またはその逆 — すべてブラウザ内で、ライブラリなしで実行。
規則: 属性は "@" 付きのキー(@id → 属性 id)、混合要素のテキストは "#text" キー、繰り返される子要素は配列になります。
JSON, YAML, CSV, XML, and TOML all solve the same problem — structured data representation — with different syntax and different trade-offs. This tool converts between all of them in both directions, right in your browser.
How to use it
- Paste data in the source format and pick a target format — the conversion happens instantly.
- For CSV, the first row is automatically treated as column headers.
- Copy the result or download it as a file with the matching extension.
Common uses
- Converting an app's configuration from YAML to JSON (or back) to match a specific framework.
- Turning a spreadsheet export (CSV) into JSON for loading into a database or API.
- Reading a TOML config (common in the Rust/Python ecosystem) in the more familiar JSON format.
Things to keep in mind
JSON ↔ YAML and JSON ↔ TOML are usually lossless in both directions, since both formats support nesting the same way JSON does.
JSON → CSV loses nested structure: CSV is a flat tabular format, so nested objects and arrays either need to be flattened into separate columns or serialized as text.
よくある質問
このツールではJSONをどの形式に変換できますか?
YAML、CSV、XML、TOMLとの間で相互に変換できます。すべてブラウザ内で処理されます。
CSVに変換すると元の構造が失われることがあるのはなぜですか?
CSVは本質的にフラットな表形式のため、事前にフラット化しない限りネストしたオブジェクトや配列を表現できません。
XML変換で属性と要素はどのように区別されますか?
このツールの規則では、「@」を先頭に付けたキーはXML属性になり、「#text」は混在コンテンツのテキスト部分として扱われます。
YAMLに変換すると数値や文字列が変わってしまうのはなぜですか?
YAMLパーサーはクォートされていない値の型を推測しようとします。"1.20" は数値の1.2になり(末尾のゼロが失われます)、"NO" は古いYAML 1.1のルールにより真偽値の false になることがあります。これを避けるには、文字列のまま保持したい値を明示的にクォートで囲んでください。
逆方向に変換しても情報は失われませんか?
JSON ⇔ YAML と JSON ⇔ TOML は、どちらもJSONと同じようにネスト構造をサポートするため、通常は情報を失わずに相互変換できます。JSON → CSV → JSON は、元にネスト構造があった場合はそれが失われます — 逆変換ではフラットな形式のデータしか戻ってきません。