100% Private
No Signup
Free Forever
One of 64 free AI tools by Mahmoud Zalt.
Free YAML / JSON Converter
Convert YAML to JSON and back|4.8 (1,690)
Paste YAML and get JSON, or paste JSON and get YAML. Powered by js-yaml, the most popular JavaScript YAML parser with tens of thousands of dependent packages on npm. Implements the YAML 1.2 specification, the version that fixed the infamous Norway problem and made YAML a strict superset of JSON. Handles nested objects, arrays, multiline strings (literal and folded block scalars), anchors, aliases, and all standard YAML features. Ideal for converting Kubernetes manifests, Docker Compose files, GitHub Actions workflows, Ansible playbooks, Helm charts, and any other YAML or JSON configuration. Runs locally in your browser, no data sent anywhere.
Free and provided as is, without warranty. Use at your own risk. Terms
Why Convert Between YAML and JSON?
YAML and JSON are the two most common configuration and data serialization formats in modern software development. YAML is the dominant format for human-written configuration, Kubernetes manifests, Docker Compose service definitions, GitHub Actions workflows, GitLab CI pipelines, Ansible playbooks, Helm chart values, and Terraform variable files are all written in YAML. JSON is the universal format for APIs, programmatic data exchange, and tool interoperability, REST APIs consume and produce JSON, package.json and tsconfig.json configure JavaScript tooling, and most programming languages have built-in JSON parsers. Converting between the two formats is a daily task for developers and DevOps engineers.
The two formats represent identical data structures, maps, sequences, strings, numbers, booleans, and null, so conversion between them is lossless for data. The main difference is syntax: YAML uses indentation and minimal punctuation for readability, while JSON uses braces, brackets, and quotes for strict, unambiguous parsing. YAML also supports features that JSON lacks, comments, multiline strings with literal (|) and folded (>) block scalars, anchors and aliases for content reuse, and a cleaner syntax for nested data. When converting YAML to JSON, comments are lost and anchors are expanded into their full form, but all data values are preserved exactly.
This tool uses js-yaml, the most widely used JavaScript YAML parser, which implements the YAML 1.2 specification. YAML 1.2 was a significant update that made YAML a strict superset of JSON (every valid JSON document is valid YAML 1.2), fixed the infamous Norway problem where country codes like "NO" were silently parsed as boolean false, and tightened the rules for implicit type detection. The conversion is instant and runs entirely in your browser, no data is sent to any server.
YAML Gotchas Every Developer Should Know
YAML is designed for human readability, but its implicit type system can cause subtle and hard-to-debug issues. The most famous example is the Norway problem: in YAML 1.1, the two-letter country code "NO" for Norway was silently interpreted as the boolean value false because no, No, NO, yes, on, off, y, and n were all recognized as boolean literals. This caused real production bugs in internationalization systems, data pipelines, and infrastructure configurations. YAML 1.2 fixed this by restricting booleans to only true, True, TRUE, false, False, and FALSE. This tool uses js-yaml which implements YAML 1.2, so the Norway problem does not apply here, but you should be aware of it when working with older YAML parsers like PyYAML (Python) which still defaults to YAML 1.1 behavior.
Other common YAML pitfalls include: version numbers like 3.10 being parsed as the floating-point number 3.1 (losing the trailing zero), strings like "null" or "Null" being parsed as null values, octal number confusion (010 was octal 8 in YAML 1.1 but is decimal 10 in YAML 1.2), and indentation errors that silently change the data structure rather than producing an error. Tabs are not allowed for indentation in YAML, only spaces, and inconsistent indentation levels will either fail to parse or produce unexpected nesting. The defensive best practice is to always quote values that are meant to be strings, especially if they could be mistaken for booleans, numbers, or null.
Converting YAML to JSON is actually one of the best debugging techniques for YAML. JSON has no implicit type coercion, every string is quoted, every number is explicit, and the structure is unambiguous. When you convert your YAML to JSON and see that a value you expected to be a string appears as a boolean or a number, you have found the bug. This converter makes that workflow instant: paste your YAML, see exactly how js-yaml interprets it, and identify any values that were silently converted to unexpected types.
YAML in the DevOps Ecosystem: Kubernetes, Docker, and CI/CD
YAML has become the universal language of DevOps and infrastructure-as-code. Kubernetes uses YAML for every resource definition, Deployments, Services, ConfigMaps, Secrets, Ingresses, PersistentVolumeClaims, CronJobs, and custom resources are all declared in YAML manifests. Docker Compose uses YAML (docker-compose.yml) to define multi-container applications with services, networks, volumes, and environment variables. GitHub Actions, GitLab CI, CircleCI, and Azure Pipelines all use YAML for pipeline definitions. Ansible uses YAML for playbooks and role definitions. Helm uses YAML for chart values and templates. Terraform uses YAML alongside HCL for variable files. The result is that a working DevOps engineer reads and writes dozens of YAML files every day.
The need to convert between YAML and JSON arises constantly in this ecosystem. Kubernetes accepts both YAML and JSON for all API calls, and tools like kubectl, kustomize, and Helm sometimes output JSON that needs to be converted to YAML for readability. Docker Compose configurations may need to be generated programmatically in JSON and then converted to YAML for use with docker compose. CI/CD pipeline configs written in YAML sometimes need to be validated or transformed using JSON-based tools. Ansible playbooks may need to consume JSON data from APIs and produce YAML output for other tools. Having an instant, private converter available in your browser removes friction from all of these workflows, paste, convert, copy, and continue working.
Concrete moments this converter gets reached for
An engineer migrating a CI pipeline from one provider to another, say from CircleCI's YAML config to a system that consumes JSON job definitions, converts each section as they translate the pipeline rather than hand-writing the JSON structure from scratch. A backend developer whose service returns a JSON configuration payload from an API converts it to YAML before handing it to a teammate who needs to hand-edit and review it, since YAML's comment support and lighter punctuation make it dramatically easier for a human to read and safely modify than the equivalent JSON.
Debugging a Helm chart or a Kustomize overlay that is not rendering the way it should often starts with converting the relevant YAML to JSON specifically to see the literal, unambiguous types js-yaml assigned to each value, catching a string that quietly became a number or a boolean is far faster in strict JSON than by eye in the original YAML.
Where YAML actually came from
YAML was created in 2001 by Clark Evans, who wanted a data format that read like plain English rather than a markup language, and it deliberately borrowed ideas from outside the XML and SGML lineage that dominated data formats at the time: Python's use of significant whitespace to define structure, and the simple key-colon-value layout of an email header (To:, From:, Subject:) that most people already found intuitive without ever learning a spec. The name itself, originally a recursive joke meaning "Yet Another Markup Language," was later reframed as "YAML Ain't Markup Language" specifically to emphasize that it was a data format, not a document markup language like the HTML and XML it was implicitly contrasted against.
That founding goal, human-readable data without markup-language ceremony, is exactly why YAML ended up as the default choice a generation later for Kubernetes, Docker Compose, and CI pipelines: those are all files a person needs to read and hand-edit regularly, which is precisely the use case YAML was designed around from day one, decades before "DevOps" was even a common term.
Choosing which format to hand-edit and which to generate
A useful rule for any pipeline that touches both formats: keep YAML as the format humans read and edit, and treat JSON as the format machines generate and consume, since YAML's comments and cleaner syntax serve human editors while JSON's strict, unambiguous structure serves programmatic generation and parsing without surprises. When you find yourself hand-editing a JSON config file, converting it to YAML first, editing it with comments explaining each change, and converting back is usually less error-prone than editing the JSON directly, especially for anything with meaningful nesting depth.
For batch conversions across many files, this tool is naturally built for one file at a time, but it is still useful as the reference implementation to validate against: convert one representative file here to confirm you understand exactly how js-yaml will interpret a specific construct (a multiline string, an anchor, an edge-case boolean) before writing or trusting a script to batch-convert the rest of a repository the same way.
How It Works
Choose YAML-to-JSON or JSON-to-YAML mode.
Paste your input and click Convert.
Copy the converted output or swap to convert back.
Need expert help with AI?
Looking for a specialist to help integrate, optimize, or consult on AI systems? Book a one-on-one technical consultation with an experienced AI consultant to get tailored advice.
Key Features
Privacy & Trust
Use Cases
Limitations
- Does not support YAML tags or custom types
- Very large files may be slow in older browsers
- Does not preserve YAML comments when converting to JSON
- Converts single YAML documents, split multi-document files (---) first
Frequently Asked Questions
Is this YAML/JSON converter free?
Yes, it is completely free with no usage limits, no signup, and no per-conversion charges. Because the conversion runs locally in your browser using the js-yaml library, there are no server costs. You can convert as many files as you need, as often as you need, without creating an account or providing any personal information.
Is my data sent to a server or stored anywhere?
No. All conversion happens entirely inside your browser using JavaScript. Your YAML and JSON content never leaves your device, not even temporarily. There are no API calls, no cloud uploads, and no analytics on your data. This makes it safe for converting sensitive configuration files that contain API keys, database credentials, or internal infrastructure details. You can verify this by checking the Network tab in your browser DevTools while converting.
What is YAML and how does it differ from JSON?
YAML (YAML Ain't Markup Language) is a human-friendly data serialization format that uses indentation instead of braces and brackets to represent structure. It supports comments, multiline strings, anchors and aliases for reusable content, and a cleaner syntax for nested data. JSON (JavaScript Object Notation) is a lightweight data interchange format that is stricter, more verbose, and universally supported by APIs and programming languages. YAML 1.2 is a strict superset of JSON, meaning every valid JSON document is also valid YAML. The two formats represent the same data structures, so conversion between them is lossless for data (though YAML comments are lost in JSON since JSON has no comment syntax).
What is the Norway problem in YAML?
The Norway problem is a well-known YAML gotcha where the country code "NO" (for Norway) gets silently interpreted as the boolean value false. In YAML 1.1, a wide range of strings were treated as booleans, yes, no, on, off, y, n, and various capitalizations were all parsed as true or false instead of strings. This caused real bugs in projects dealing with country codes, environment variables, and toggle settings. YAML 1.2 fixed this by restricting boolean values to only true, True, TRUE, false, False, and FALSE. This tool uses js-yaml which implements YAML 1.2, so the Norway problem does not apply here.
Q&A SESSION
Got a quick technical question?
Skip the back-and-forth. Get a direct answer from an experienced engineer.