JSON→YAML変換

トレンド 🔥

JSON ↔ YAML を即座に変換

開発者ツール

JSON→YAML変換 の使い方

  1. 1入力エディタに JSON データを貼り付ける
  2. 2変換方向を選択: JSON→YAML または YAML→JSON
  3. 3変換された出力が右側に即座に表示される
  4. 4ワンクリックで結果をコピー

JSON→YAML変換 について

JSON から YAML へのコンバーターは、JSON データを人間が読みやすい YAML 形式に変換する専用ツールです。YAML は Kubernetes、Docker などの設定ファイルで広く使用されています。

JSON→YAML変換の主な機能

  • Bidirectional conversion: JSON → YAML and YAML → JSON
  • Handles nested objects, arrays, strings, numbers, and booleans
  • Produces properly indented, human-readable YAML output
  • Supports multiline strings in YAML (block scalars)
  • Validates JSON input before converting
  • Works entirely in-browser — no server uploads
  • One-click copy of the converted output
  • Ideal for Kubernetes, Docker Compose, and GitHub Actions config files

対応フォーマット

入力フォーマット

JSON オブジェクトと配列YAML ファイルとスニペット

出力フォーマット

フォーマット済み YAMLフォーマット済み JSON

JSON に変換する際、YAML コメントは保持されません。

使用例

Convert a JSON config to YAML for a Kubernetes deployment

Transform a JSON application config into a YAML format for use in a Kubernetes manifest.

入力

{"replicas":3,"image":"nginx:latest","port":80}

出力

replicas: 3
image: nginx:latest
port: 80

Convert a YAML GitHub Actions workflow to JSON

Extract YAML config data and convert it to JSON for programmatic processing.

入力

name: CI
on:
  push:
    branches: [main]

出力

{"name":"CI","on":{"push":{"branches":["main"]}}}

主な使用ケース

  • Converting JSON API responses to YAML for use in Kubernetes or Helm charts
  • Transforming YAML configuration files to JSON for programmatic processing
  • Converting Docker Compose YAML to JSON for validation or templating tools
  • Translating GitHub Actions workflow YAML for analysis or modification
  • Preparing YAML configuration files from JSON data sources
  • Converting OpenAPI / Swagger definitions between JSON and YAML formats

トラブルシューティング

YAML output has unexpected indentation or line breaks

解決策

YAML indentation is significant. The converter uses 2-space indentation. Ensure you paste the complete YAML block and check that no extra spaces were added when copying.

Special YAML characters like : or # break the output

解決策

In YAML, colons after keys and hash signs in values must be handled carefully. The converter wraps such values in quotes automatically. If you see issues, check the raw output for unquoted values.

YAML to JSON conversion drops comments

解決策

JSON has no comment syntax, so YAML comments (#) cannot be represented in JSON and are dropped during conversion. This is expected behavior — comments are only meaningful in YAML context.

よくある質問

Does it support all YAML features?

The tool handles standard YAML including nested objects, arrays, multiline strings (block scalars), and all scalar types. Anchors, aliases, and custom YAML tags (!!type) may not be fully preserved.

Are YAML comments preserved when converting to JSON?

No. JSON has no comment syntax, so YAML comments are dropped during conversion. This is a fundamental limitation of the JSON format, not a bug in the tool.

Can I convert a multi-document YAML file?

Multi-document YAML files (separated by ---) may not convert correctly as a single JSON output. Split documents individually and convert each one separately.

How does the tool handle YAML booleans and null?

YAML true/false become JSON true/false, and YAML null/~/~ become JSON null. YAML also treats yes/no and on/off as booleans in some parsers — the converter normalizes these to JSON boolean values.

Can I convert OpenAPI YAML to JSON?

Yes. OpenAPI definitions are valid YAML and JSON. Paste the YAML definition and select YAML → JSON to get the equivalent JSON OpenAPI spec.

Is indentation significant in YAML input?

Yes. YAML uses indentation to define nesting levels. Inconsistent indentation is a common source of YAML parse errors. If conversion fails, check that all lines use consistent 2-space or 4-space indentation.

Is my data sent to a server?

No. All conversion is performed locally in your browser. Your YAML and JSON data never leaves your device and is not transmitted or stored.

What is the difference between JSON and YAML?

Both represent structured data, but YAML is optimized for human readability — it uses indentation instead of braces, allows comments, and has a less verbose syntax. JSON is more strictly defined and universally supported in APIs and programming languages.