JSON to YAML Converter

Convert JSON to YAML or YAML to JSON

Tags: convert code json yaml

🚀 187,119 total conversions (1 this month)

Practice Python with coding challenges

Solve hands-on problems right in this editor: run the sample tests, submit, and get an AI code review.

All Python challenges
Easy

Average of Three

Average three whole numbers.

You'll learn ArithmeticDivision
BeginnerLearning-pathVariables
Easy

Rectangle Perimeter

Compute the perimeter of a rectangle from its sides.

You'll learn ArithmeticReturn values
BeginnerLearning-pathVariables
Medium

One Generation of a Genetic Algorithm

Breed the next generation of bit strings with tournament selection, single-point crossover and mutation.

You'll learn Genetic algorithmsEvolutionary search
OptimizationSimulationai
No solutions yet
Easy

Epsilon-Greedy Multi-Armed Bandit

Balance exploration and exploitation on a multi-armed bandit with epsilon-greedy action selection.

You'll learn Explore vs exploitBandits
Reinforcement learningaimachine learning
No solutions yet
Easy

Markov Chain State Distribution

Propagate a probability distribution through a Markov chain's transition matrix for a number of steps.

You'll learn Markov chainsProbability
Simulationaimath
No solutions yet
Medium

Value Iteration

Compute how valuable each state of a Markov decision process is by repeatedly applying the Bellman optimality update.

You'll learn Bellman equationMDPs
Reinforcement learningaimachine learning
No solutions yet
Medium

Q-Learning Updates

Apply the Q-learning update to a stream of experiences and watch rewards flow back to earlier states.

You'll learn Q-learningDiscounted rewards
Reinforcement learningaimachine learning
No solutions yet
Medium

Alpha-Beta Pruning

Evaluate a game tree with minimax and alpha-beta pruning, and count how many leaves the search really looks at.

You'll learn Alpha-beta pruningGame search
RecursionTreesai
No solutions yet
Medium

Minimax Tic-Tac-Toe

Pick the perfect tic-tac-toe move by searching the whole game tree with minimax.

You'll learn MinimaxGame trees
Recursionai
No solutions yet
Medium

A* Search on a Weighted Grid

Find the cheapest path across a grid of terrain costs with A*, the search algorithm behind game and robot pathfinding.

You'll learn A* searchHeuristics
GraphsGridsShortest-pathai
No solutions yet
Medium

Temperature and Top-K Sampling

Choose the next token like a language model does: keep the top k logits, apply temperature, and sample.

You'll learn Text generationSampling
aimachine learning
No solutions yet
Hard

Multi-Head Self-Attention

Project the input into queries, keys and values, run attention in several heads in parallel, and combine them.

You'll learn Multi-head attentionMatrix projections
aimachine learning
No solutions yet

What is This Tool?

This free online converter makes it simple to switch between JSON and YAML formats. Whether you're working with API payloads or configuration files, this tool helps you convert data formats quickly and accurately.

How to Use

  1. Paste or write your JSON or YAML code into the editor.
  2. Click Convert to instantly switch formats.
  3. Download, copy, or share the result with one click.

You can also sign in with Google or GitHub to save your conversion history or download results later.

What is JSON?

JSON (JavaScript Object Notation) is a lightweight, human-readable data format used widely for transmitting data between servers and web apps. It uses key-value pairs and array structures to represent data and is the most common format in modern APIs.

JSON is supported natively in most programming languages, making it the go-to format for data serialization and RESTful services.

Learn more at the official JSON website.

JSON Example


{
  "firstName": "Duke",
  "lastName": "Java",
  "age": 18,
  "address": {
    "street": "100 Internet Dr",
    "city": "JavaTown",
    "state": "JA",
    "postalCode": "12345"
  },
  "phoneNumbers": [
    { "Mobile": "111-111-1111" },
    { "Home": "222-222-2222" }
  ]
}

    

What is YAML?

YAML (YAML Ain’t Markup Language) is a readable data-serialization format often used for configuration files (e.g., Docker, Kubernetes, GitHub Actions). It’s more concise than JSON and easier for humans to write and edit.

YAML supports complex structures like lists, maps, anchors, and references, and is compatible with JSON-meaning every valid JSON file is also valid YAML 1.2.

Learn more at the YAML Wikipedia page.

YAML Example


---
receipt:     Oz-Ware Purchase Invoice
date:        2012-08-06
customer:
  first_name: Dorothy
  family_name: Gale

items:
  - part_no: A4786
    descrip: Water Bucket (Filled)
    price: 1.47
    quantity: 4
  - part_no: E1628
    descrip: High Heeled "Ruby" Slippers
    size: 8
    price: 133.7
    quantity: 1

bill-to: &id001
  street: |
    123 Tornado Alley
    Suite 16
  city: East Centerville
  state: KS

ship-to: *id001

specialDelivery: >
  Follow the Yellow Brick
  Road to the Emerald City.
  Pay no attention to the
  man behind the curtain.

    

JSON vs YAML Example

JSON


{
  "ProductID": 10440,
  "SKU": "KOI-721",
  "Name": "Basic Beauty Dress",
  "Price": 52,
  "ColorSwatches": [
    { "color": "Rosewood", "price": 42 },
    { "color": "Thyme Green", "price": 59.99 }
  ]
}

    

YAML


---
ProductID: 10440
SKU: "KOI-721"
Name: "Basic Beauty Dress"
Price: 52
ColorSwatches:
  - color: "Rosewood"
    price: 42
  - color: "Thyme Green"
    price: 59.99