Why convert OpenAPI YAML to JSON?
Many tooling chains require JSON: Postman imports, AWS API Gateway, Azure API Management, and most code generators (openapi-generator, swagger-codegen) accept JSON natively. YAML is preferred for hand-editing because of comments and lower visual noise, but JSON is the canonical wire format.
Does this support OpenAPI 3.1?
Yes. The converter works for any structurally valid OpenAPI / Swagger document — 2.0, 3.0.x, and 3.1. It walks the YAML tree and emits the equivalent JSON regardless of the spec version.
Are $ref pointers preserved?
Yes. $ref strings are passed through unchanged — the converter does not dereference or resolve them. If you need a fully bundled spec with all $refs inlined, use a CLI tool like swagger-cli bundle or redocly bundle.
Will my API keys or example tokens be uploaded?
No. The conversion runs entirely in JavaScript inside your browser. No request is made when you click Convert — verify in your browser DevTools Network tab. Specs containing example bearer tokens, internal hostnames, or staging URLs never leave your device.
What if my YAML has anchors or merge keys?
This minimal converter handles the YAML subset typical in OpenAPI specs (objects, arrays, scalars, multi-line block style). Anchors (&) and merge keys (<<) are uncommon in OpenAPI and are not expanded — if your spec uses them, run yq or js-yaml locally first.
How is JSON output formatted?
JSON is pretty-printed with 2-space indentation — the same convention used by Stripe, GitHub, and most public OpenAPI specs. To minify, copy the output into our JSON Minifier.
Why not just use yq or python -c "import yaml,json"?
Both work locally, but require installing tooling. This page is a zero-install browser tool — useful when reviewing a spec on a colleague's machine, in a CI log review, or on a locked-down work laptop where pip / brew are restricted.
Can I convert a Swagger 2.0 file?
Yes. Swagger 2.0 (which uses the swagger: "2.0" field instead of openapi:) is just YAML — the converter treats it the same way. The output is valid Swagger 2.0 JSON.