SITE UNDER CONSTRUCTION. Everything here is provided AS IS, WITHOUT WARRANTIES, to the extent the law allows. It is information, not professional advice. Use at your own risk. Terms and liability limits →

eThorns ES
← DeveloperES

Tool 5.3

YAML to JSON and JSON to YAML converter

Convert YAML to JSON and back in your browser. Reads YAML 1.2, flags values old YAML 1.1 tools read differently, and refuses aliases and tags.

Runs on your deviceRuns entirely in your browser: nothing you type or upload leaves your device.

How to use it

  1. Choose YAML → JSON or JSON → YAML, and the indentation: 2 or 4 spaces, or minified JSON.
  2. Paste the text, or drop a .yaml, .yml or .json file of up to 5 MB on the box. The result updates as you type.
  3. If the tool shows an error, fix the line it names. Then copy the result or download it as a .json or .yaml file.

When you need to switch between YAML and JSON

Configuration files for Docker Compose, Kubernetes, CI pipelines and OpenAPI are usually written in YAML, while APIs, test tools and most programming languages expect JSON. Converting lets you paste a config into a request body, compare it with an API response, or see exactly what a program will read from an indented file.

The conversion runs in your browser and nothing is uploaded, which matters when the file holds passwords or internal addresses. YAML → JSON reads YAML 1.2, the current version, and follows its core schema for numbers, true, false and null. JSON → YAML writes block YAML with 2 or 4 spaces and puts quotes only on the text values that would otherwise change meaning.

Example: a DANE code and a no

Paste ciudad: Medellín, codigo_dane: 05001 and envio_gratis: no, one per line. The JSON comes out as "codigo_dane": 5001 and "envio_gratis": "no": in YAML 1.2, 05001 is a number, so the leading zero is lost, and only true and false are booleans. The tool also warns that older programs that follow YAML 1.1 read lines 2 and 3 differently, 05001 as the octal number 2561 and no as false.

Write what you mean and every reader agrees: codigo_dane: "05001" for a code, and envio_gratis: false for a yes-or-no value. The same care applies to yes, on, off, times such as 1:20 (80 in YAML 1.1) and dates. Long integer IDs keep every digit in browsers that support it, instead of being rounded after 15 or 16 digits.

What the tool refuses, and why

It reads the parts of YAML that config files use: nested maps and lists, [ ] and { } collections on one line, quoted and plain values, comments, and multi-line | and > blocks. Anchors and aliases (& and *) are refused, which also stops the billion laughs file, a few lines that expand into billions of copies and freeze whatever reads them. Tags (!) are refused, because some YAML libraries use them to build program objects.

Merge keys (<<), a second document in the same file, repeated keys, and text that continues on the next line without quotes are refused too. Each refusal names the line; nothing is guessed. To convert a file that uses anchors, first expand it with the program that reads it.

FAQ

Is my file uploaded?

No. The conversion runs in your browser, and a file you drop is read on your device. Nothing is sent to a server.

Why isn't yes converted to true?

YAML 1.2, from 2009, stopped treating `yes`, `no`, `on` and `off` as booleans; only `true` and `false` remain. Many older programs still follow YAML 1.1, so the tool warns on those lines. Write `true` or `false`, or put the word in quotes if it is text.

Can I convert a file with several documents separated by ---?

Not in one go. A single `---` at the top and `...` at the end are fine, but a second document is refused with its line number. Paste one document at a time.

What happens to the comments?

YAML → JSON drops them, because JSON has no comments. JSON → YAML has none to keep.

Why does JSON → YAML put some values in quotes?

A bare value that YAML would read as something else gets quotes: `"true"`, `"123"`, `"yes"`, `"~"`, an empty text, or text that contains `: ` or ` #`. Without them, the YAML would come back as a boolean, a number or null instead of text.

  • 5.1JSON formatterFormat or minify JSON and find syntax errors by line and column.
  • 5.2CSV to JSON converterConvert CSV to JSON or JSON to CSV with comma, semicolon or tab separators.
  • 5.4Base64Encode or decode Base64 in your browser: UTF-8 text, URL-safe Base64, files to Base64 or data URLs, and Base64 back to a downloadable file.
  • 5.5Color contrast checkerCheck the contrast ratio of a text color on its background against WCAG 2.2 AA and AAA, for normal text, large text and UI components.
  • 5.6Cron explainerRead a 5-field cron expression as a plain sentence and see its next 5 run times in your time zone.
  • 5.7Number base converterConvert whole numbers between decimal, hexadecimal, binary and octal, with bit length and grouped digits.
  • 5.8HTML entity encoderEncode text as HTML entities (named, decimal or hex) or decode entities back to text: <, >, &, quotes, Spanish accents, Latin-1 symbols.
  • 5.9URL encodePercent-encode or decode URLs and query values, and break any URL into protocol, host, path, query parameters and fragment.
  • 5.10SHA-256 hashGet SHA-1, SHA-256, SHA-384 and SHA-512 hashes of text or files and verify a download against its published checksum.
  • 5.11UUID generatorGenerate random UUID v4 or time-ordered UUID v7 (RFC 9562) in your browser, 1 to 1000 at a time, in uppercase or without dashes.
  • 5.12Unix timestampConvert Unix timestamps in seconds or milliseconds to ISO 8601, UTC and your local time, or a date back to epoch.
  • 5.13JWT decoderDecode a JSON Web Token in your browser: see the header and payload as formatted JSON and whether it has expired.
  • 5.14Regex testerTest regular expressions live: highlighted matches, capture and named groups, flags and clear errors.

╌╌ END ╌╌