JSON to YAML Converter
Paste one JSON value and copy its block YAML representation. This page opens in the JSON to YAML direction, even when you last used the other direction. Choose two or four spaces. Strings that look like booleans, numbers or dates are quoted so a downstream YAML reader is less likely to change their type; JSON number literals keep their digits.
name: gizmobench released: "2026-09-21" debug: "no" port: 8080 tags: - config - yaml
Converted to YAML: 7 lines, 5 keys, no warnings.
Read as JSON and printed as YAML 1.2 core, 2 spaces per level. 2 strings are quoted here, so no reader turns them into a number, a boolean or a date.
- {"debug": "no"}
- {"released": "2026-09-21"}
- {"id": "9007199254740993"}, 1 warning
Up to 500,000 characters in one pass, converted here in your browser with nothing uploaded and no account. Nothing in the document is ever run or fetched: a tag is a string to the reader, a URL is a string, and alias expansion stops after 10,000 copied nodes. Nesting is read 100 levels deep. The direction, the indent and the draft are kept in this browser alone, drafts up to 100,000 characters, and the Start over control above the tool forgets them.
Common questions
- How do I convert a JSON file to YAML or YML?
- Copy its text into the input and use Copy YAML after a valid result appears. .yaml and .yml are alternative extensions for the same serialization. Save the copied result in your own editor; this page has no file picker or download action.
- Why are strings such as no, 123 and a date quoted?
- Those are strings in JSON but can be interpreted as another type by a YAML reader, especially one using YAML 1.1 rules. The converter quotes ambiguous strings, empty strings, leading or trailing spaces and multiline strings. A true JSON boolean stays a boolean, and a JSON null stays null.
- Are long integers, arrays and nested objects preserved?
- Number literals keep their digits on this conversion direction, including 9007199254740993. Arrays keep order and nested objects become block mappings. A duplicate JSON key cannot produce two meaningful mapping entries: it is collapsed to the later value with a warning. Read the warnings before using the result.
- Will the JSON to YAML to JSON round trip always match?
- Not always. The reverse YAML-to-JSON path writes an integer beyond JavaScript’s safe integer range as a warned string rather than rounding it. Comments are absent from JSON, and anchor names are not restored. Check types as well as visible text when moving between readers.
- Can it convert JSON into an OpenAPI or Swagger YAML contract?
- It can reserialize an existing JSON specification, within the supported input limits. It does not infer paths, request parameters, responses or a specification version from arbitrary JSON data, translate a JSON Schema into an API contract or migrate an API specification. Application validity needs its own checker. An existing JSON Schema document can also be reserialized as YAML values; that is not a schema-language conversion, and a checker expecting JSON will need JSON input.
- What input does it refuse?
- Invalid JSON, input beyond 500,000 characters and nesting past 100 levels are refused. Comments, trailing commas, single quotes and an unquoted key are named with a position. Both directions are manual browser workflows; there is no remote URL or command-line service.
Converted by a YAML 1.2 core-schema reader written for this page, so yes and no stay strings and a date-shaped value stays text rather than becoming a timestamp. An integer JSON cannot hold exactly is preserved as a string and warned about rather than silently rounded, alias cycles and alias chains past a fixed budget are refused, and both directions run in this browser with nothing uploaded.