DevsToolkit

YAML to JSON

YAML

Convert YAML data to JSON format with configurable indentation

All processing happens locally in your browser — your data never leaves your machine.
Loading tool...

Examples

Docker Compose Snippet

Input
version: "3.8"
services:
  web:
    image: nginx:latest
    ports:
      - "80:80"
      - "443:443"
    volumes:
      ...
Output
{
  "version": "3.8",
  "services": {
    "web": {
      "image": "nginx:latest",
      "ports": [
        "80:80",
    ...

Kubernetes Config

Input
apiVersion: v1
kind: Service
metadata:
  name: my-service
  labels:
    app: web
spec:
  selector:
    app: web
  ports:...
Output
{
  "apiVersion": "v1",
  "kind": "Service",
  "metadata": {
    "name": "my-service",
    "labels": {
      "app": "web...

Simple Config

Input
database:
  host: localhost
  port: 5432
  name: myapp
  credentials:
    username: admin
    password: secret
logging:
...
Output
{
  "database": {
    "host": "localhost",
    "port": 5432,
    "name": "myapp",
    "credentials": {
      "username":...

Frequently Asked Questions

What YAML features are supported?
The converter supports all standard YAML features including nested objects, arrays, multi-line strings, anchors, aliases, and complex data types. It uses the js-yaml library for reliable parsing.
How are YAML data types converted to JSON?
YAML strings become JSON strings, YAML integers and floats become JSON numbers, YAML booleans (true/false, yes/no) become JSON booleans, and YAML null values become JSON null. Nested mappings become JSON objects and sequences become JSON arrays.
Can I convert multi-document YAML files?
This tool converts the first YAML document in the input. If your file contains multiple documents separated by '---', only the first document will be converted. Split multi-document files before converting.

Related Tools