Конвертер YAML в JSON

Нужна обратная конвертация?
JSON to YAML Converter

Ввод YAML

1

Вывод JSON

Введите данные YAML, чтобы преобразовать в JSON

Преобразованные данные появятся здесь

Как конвертировать YAML в JSON онлайн — пошаговое руководство

Используйте этот конвертер YAML → JSON, чтобы преобразовать конфиги, Kubernetes‑манифесты или CI/CD‑настройки в JSON для API и инструментов.

  1. Шаг 1 — Вставьте или загрузите YAML

    • Вставьте YAML в левый редактор или загрузите файл .yaml/.yml.
    • Подходит для Kubernetes, Docker Compose, GitHub Actions и любых YAML‑данных.
    • Мульти‑документ YAML (разделённый ---) конвертируется в JSON‑массив.
  2. Шаг 2 — Проверьте конвертацию

    • JSON вывод появляется справа, сохраняя вложенные структуры и типы данных.
    • Комментарии YAML удаляются (JSON не поддерживает комментарии).
    • Проверьте корректность массивов, объектов и скалярных значений.
  3. Шаг 3 — Обработайте крайние случаи

    • Якоря и алиасы YAML могут требовать ручной правки в сложных файлах.
    • Булевы значения (true/false, yes/no) нормализуются в JSON‑булевы.
    • Числа и строки сохраняются с корректным JSON‑форматированием.
  4. Шаг 4 — Скопируйте или скачайте JSON

    • Нажмите «Копировать», чтобы отправить JSON в буфер обмена.
    • Или «Скачать», чтобы сохранить как .json.
    • Используйте JSON в REST API, фронтенд‑приложениях или любом инструменте, которому нужен JSON‑ввод.

Quick tips for YAML to JSON

  • Ensure indentation is consistent in your YAML; most conversion errors come from bad indent levels.
  • Multi-document YAML will be converted to a JSON array, which is ideal for lists of configs or resources.
  • After converting, run the JSON through the validator or formatter to catch any remaining structural issues.
Example: YAML to JSON
# YAML input
apiVersion: v1
kind: ConfigMap
metadata:
  name: app-config
data:
  database_url: postgres://localhost/db
  debug: true
  ports:
    - 8080
    - 8081

// JSON output
{
  "apiVersion": "v1",
  "kind": "ConfigMap",
  "metadata": {
    "name": "app-config"
  },
  "data": {
    "database_url": "postgres://localhost/db",
    "debug": true,
    "ports": [8080, 8081]
  }
}

Related YAML & JSON tools

Convert between formats and work with configuration files using these complementary tools.

Часто задаваемые вопросы

What YAML features are supported in the conversion?

The converter supports standard YAML features including scalars, sequences (arrays), mappings (objects), multi-line strings, and basic YAML syntax. Complex YAML features like anchors and references may have limited support.

How are YAML comments handled during conversion?

YAML comments are typically stripped during conversion to JSON since JSON doesn't support comments. The conversion focuses on the data structure rather than preserving comments.

Can I convert complex nested YAML structures?

Yes, the converter can handle deeply nested YAML structures with multiple levels of objects and arrays. The resulting JSON will maintain the same hierarchical structure.

What happens to YAML data types during conversion?

YAML data types are converted to their JSON equivalents: strings remain strings, numbers become JSON numbers, booleans stay as booleans, and null values are preserved. YAML's additional data types are converted to their closest JSON representation.

Конвертер YAML в JSON | JSONSwiss