Tool

Online YAML to JSON converter

Convert YAML 1.2 Core to JSON with exact integers and error diagnostics.

Your data is processed locally in your browser and is not sent to our servers.

Shortcut: Ctrl or ⌘ + Enter
Read only · 2-space indentation

Enter a YAML document to convert it to JSON.

Verifiable example

This YAML document contains a map, numbers, a boolean, a string that looks like a number, and a list:

service:
  name: api
  port: 8080
  active: true
  version: '1.0'
  tags:
    - production
    - private

The result preserves the structure and types:

{
  "service": {
    "name": "api",
    "port": 8080,
    "active": true,
    "version": "1.0",
    "tags": [
      "production",
      "private"
    ]
  }
}

How it works

Paste a single document and press Convert to JSON, or use Ctrl/⌘ + Enter. The tool parses YAML 1.2 Core and generates JSON with two-space indentation and a final line break.

It normalizes hexadecimal and octal integers to decimal without losing precision. You can then copy or download the .json file.

If you are starting from JSON, see how to convert it to YAML without losing types.

The library is loaded only when you use the editor. Everything happens in this tab, without processing requests, storage, or URL changes. Optional page-view measurement never receives the YAML or its result.

Common uses

  • Adapt YAML to an API that only accepts JSON.
  • Prepare JSON examples for documentation or testing.

What YAML is supported

A YAML 1.2 Core document is accepted: block-style or flow-style maps and lists, comments, single-quoted, double-quoted, or multiline strings, and scalar root values. Supported types include null, booleans, integers, and finite decimals. You can also use Core tags such as !!str, !!int, !!map and !!seq.

yes, no, on, and off are text in YAML 1.2. The %YAML 1.1 directive is rejected to avoid older, ambiguous rules.

Common errors

  • Indentation with tabs: YAML uses spaces to define blocks.
  • Missing space after a colon: in a map, the value usually requires a space after :.
  • Repeated keys: different readers can retain different values; the tool asks to resolve the duplication before converting.
  • Multiple documents: separate the documents delimited by --- and convert them one by one.
  • Non-string keys: JSON property names must be strings. Quote a YAML key that would otherwise resolve as a number, boolean, or null.

When the parser knows the location of a syntax error, the message includes line and column and places the cursor near the problem.

Anchors, aliases and merge keys

JSON does not express shared references. The converter therefore rejects anchors (&name), aliases (*name), and unquoted merge keys (<<) instead of expanding them: expansion could duplicate data or hide conflicts.

Expand those properties in your editor before converting. If << is really the literal name of a property, enclose it in quotes: "<<".

Safety limits

  • Maximum input of 1,000,000 characters.
  • A single document and up to 100 levels of nested collections.
  • A maximum of 100,000 nodes and 2,000,000 output characters.
  • Anchors, aliases, merges, custom tags, duplicate keys, and non-finite numbers such as .nan or .inf are not supported.
  • Keys like __proto__, constructor and prototype are treated as text literals; the result is written directly from the syntax tree without assigning them to a JavaScript object.

Frequently asked questions

Is my configuration sent to a server?

No. The document is analyzed and converted in your browser. The input is not saved; closing or reloading the page clears it.

Do large integers lose precision?

No. Integers are normalized with exact arithmetic and written directly to the output. Keep in mind that the program that then reads the JSON could convert them to a numeric type with less precision.

Reviewed on by Tools in a Tab.