Data tool

YAML/JSON converter

Convert pasted JSON to YAML, or YAML to formatted JSON. Everything runs in your browser.

Input

Source text

Output

Converted result

Usage examples

Convert a JSON API example into readable YAML for documentation, or turn a small YAML configuration into formatted JSON for a tool that only accepts JSON. After conversion, compare booleans, numbers, nulls, arrays, and nested mappings rather than checking indentation alone. The output is a new serialization of the parsed data, not a text-preserving rewrite.

Readable errors

Invalid input leaves the result blank and places a parser message beside the controls, including line and column when the YAML parser provides them. JSON mode rejects comments and trailing commas. YAML mode can parse richer syntax than JSON, but the result still has to fit JSON-compatible data before it can be serialized usefully.

Limitations

Comments, anchors, aliases, tags, quoting style, and original key spacing are presentation features that may be resolved or lost during a round trip. The tool does not validate an application schema or promise byte-for-byte reversibility. It handles pasted text only, so keep the original file and use a project-aware formatter for production configuration changes.

Privacy

Parsing and serialization run locally in this browser tab. The page does not upload, store, or send pasted JSON or YAML to a server. Treat the converted result as sensitive when the source contains credentials or internal configuration, and verify the destination's policy before copying it elsewhere.

Move documents between JSON and YAML without leaving the browser. Use JSON→YAML when humans need a readable config snapshot. Use YAML→JSON when a tool chain only accepts JSON.

Verified round trip

JSON {"name":"모듈","tags":["a","b"]} becomes:

name: 모듈
tags:
  - a
  - b

Converting back yields an equivalent JSON object. Key order may differ after serialization; sort with the JSON formatter before textual diffs.

Collaboration pattern

Keep commented YAML as the source of truth in git. Emit JSON only at the boundary that requires it. If application code emits JSON that operators must read, convert to YAML for review, then discard that YAML rather than editing it as canonical.

Watch unquoted values: 01, NO, true may change type depending on YAML rules. Quote strings that must stay strings, then convert again and inspect types in JSON mode.

Limits

Huge documents, cyclic structures and exotic YAML tags may fail or simplify. Treat the page as a scalpel for samples and debugging, not a bulk ETL engine. Pair with the workbench when hashing or Base64 follows the conversion.

Concrete scenarios

Scenario A — document an API. Capture a JSON response, convert to YAML, and add human comments in the editor afterward. Remember that converting back to JSON drops those comments, so store the commented YAML separately if comments matter.

Scenario B — debug CI. Paste the failing YAML fragment, convert to JSON, and read the position-aware error. Mixed tabs and spaces, or a missing indent under a list item, are usual culprits.

Scenario C — feed a JSON-only CLI. Convert the ops YAML to JSON, pipe into the tool, and keep YAML in git. Automate the conversion in CI once the sample looks right here.

Type gotchas worth a second look

Unquoted NO, Yes, 01, or version-looking tokens may become booleans or integers depending on YAML rules. After YAML→JSON, inspect types explicitly. Quote anything that must remain a string. When comparing two JSON emits, run them through the JSON formatter’s sort mode so key order does not create fake diffs.

This page is intentionally narrow. Image work, character counting and romanization live elsewhere; chaining several text transforms belongs in the workbench.

What success looks like

A successful conversion is boring: types match intent, comments are either preserved in the YAML source of truth or consciously discarded, and CI consumes JSON without hand edits. Use this page to prove the boring path on a sample, then automate. If you find yourself pasting megabytes repeatedly, move the step into a scripted pipeline where it belongs.

Minimal acceptance test

Take one real (non-secret) config, convert YAML→JSON→YAML, and read the second YAML. Structure should match; comments will be gone. If types shifted, quote the offenders in the source YAML and repeat until the JSON types look right. That loop is the whole point of a browser-local converter.

FAQ

Which parsers are used?

JSON uses JSON.parse/stringify. YAML uses the bundled yaml library. JSON→YAML uses indent 2 and lineWidth 0.

Are comments preserved?

No. YAML comments and anchors do not survive a round trip through JSON.

Is input uploaded?

No. Conversion is local to the tab.

Do YAML errors include positions?

When the library exposes line and column, the status line includes them.